Documentation
¶
Overview ¶
Package telemetry installs OpenTelemetry for the anfra CLI and `anfra serve`: the global tracer provider and W3C propagation, which the spans anfra already makes (apptracing's per op, httpkit's per request) go to.
Off unless an endpoint is set. Everything is configured by the standard OTEL_* environment variables, which the SDK and its exporter read themselves: OTEL_EXPORTER_OTLP_ENDPOINT (or OTEL_EXPORTER_OTLP_TRACES_ENDPOINT) turns export on, over OTLP/HTTP; OTEL_SERVICE_NAME and OTEL_RESOURCE_ATTRIBUTES label it; and OTEL_SDK_DISABLED=true turns it off. Without an endpoint nothing is installed and spans are the API's no-ops.
A copy of anfra-cloud's shared/telemetry, trimmed to traces and over HTTP, as anfra-node exports: one collector endpoint serves both.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Setup ¶
func Setup(ctx context.Context, service, version string) (shutdown func(context.Context) error, err error)
Setup installs the tracer provider the environment asks for, and returns the function that flushes and stops it; call it on the way out, with a deadline. On error nothing is installed.
Types ¶
This section is empty.