otel

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2026 License: MIT Imports: 9 Imported by: 0

README

go-otel 🔭

Tiny OpenTelemetry bootstrap for Go services — one call wires an OTLP/gRPC trace exporter into a global TracerProvider and installs W3C trace-context propagation.

📦 Install

go get github.com/Bugs5382/go-otel

🚀 Usage

shutdown, err := otel.Init(ctx, "my-service", "localhost:4317")
if err != nil {
	log.Fatal(err)
}
defer shutdown(context.Background())

Spans export over OTLP/gRPC (insecure) to the given endpoint, tagged with service.name. Metrics and logs exporters are planned for later releases. 📈

🛠 Develop

task build    # go build ./...
task test     # go test ./...
task lint     # gofmt check + golangci-lint + yamllint
task license  # inject MIT headers (golic)

⚖️ License

MIT © 2026 Shane

Documentation

Overview

Package otel wires an OTLP gRPC trace exporter into a global TracerProvider. Ships traces only for now; metrics and logs exporters arrive in later releases.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(ctx context.Context, service, otlpEndpoint string) (shutdown func(context.Context) error, err error)

Init configures a global TracerProvider that exports spans over OTLP gRPC (insecure) to otlpEndpoint, tagged with service.name=service. The returned shutdown func flushes and closes the provider; callers should defer it.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL