Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MaybeSetup ¶
MaybeSetup OpenTelemetry if OTEL_SERVICE_NAME is set. Returns a shutdown function and an error. If OTel is not enabled, it returns a no-op shutdown function and nil error.
func NewOpenTelemetryChiMiddleware ¶
Returns a opentelemetry middleware meant to be used with the chi.Router.
func SetupOpenTelemetry ¶
func SetupOpenTelemetry(ctx context.Context, projectID string) (shutdown func(context.Context) error, err error)
Instruments the application with OpenTelemetry and exports OTLP for metrics and traces. It uses log/slog for logging, and writes logs to stdout. The application does not include any GCP dependencies, and instead only uses open standards for instrumentation. The OpenTelemetry collector is used to route telemetry to GCP. Afterwards, metrics, tracing, logging, and context propagation will be setup.
Types ¶
This section is empty.