Documentation
¶
Overview ¶
Package otel provides an OpenTelemetry backend for wool.
Import this package to enable OTEL tracing in wool:
import _ "github.com/codefly-dev/core/wool/otel"
Or call Enable() explicitly for configuration:
otel.Enable(otel.WithEndpoint("localhost:4317"), otel.WithServiceName("my-svc"))
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GRPCDialOptions ¶
func GRPCDialOptions() []grpc.DialOption
GRPCDialOptions returns gRPC dial options that enable automatic OTEL tracing for all outgoing RPCs.
func GRPCServerOptions ¶
func GRPCServerOptions() []grpc.ServerOption
GRPCServerOptions returns gRPC server options that enable automatic OTEL tracing for all incoming RPCs.
Types ¶
type Option ¶
type Option func(*config)
Option configures the OTEL provider.
func WithEndpoint ¶
WithEndpoint sets the OTLP collector endpoint (e.g. "localhost:4317").
func WithServiceName ¶
WithServiceName sets the service name for traces.
func WithStdout ¶
func WithStdout() Option
WithStdout uses a stdout exporter instead of OTLP (useful for development).
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider implements wool.TelemetryProvider backed by OpenTelemetry.
func Enable ¶
Enable creates an OTEL TelemetryProvider and registers it with wool. If no options are provided, it reads from standard OTEL environment variables (OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_SERVICE_NAME).