example/otel-metrics/README.md
This example demonstrates how to enable OpenTelemetry metrics for Redis operations using the extra/redisotel-native package.
localhost:6379localhost:4317 (optional)# Start Redis (if not already running)
redis-server
# Optional: Start OTLP collector
# See: https://opentelemetry.io/docs/collector/
# Run the example
go run main.go
The example automatically collects:
To use with a production OTLP collector:
exporter, err := otlpmetricgrpc.New(ctx,
otlpmetricgrpc.WithEndpoint("your-collector:4317"),
otlpmetricgrpc.WithTLSCredentials(credentials.NewClientTLSFromCert(certPool, "")),
)