Documentation
¶
Overview ¶
Package observability exports Credimi traces, metrics and logs over OTLP/HTTP (SigNoz). Export is on only when OTEL_EXPORTER_OTLP_ENDPOINT is set; the exporters read the standard OTEL_* variables themselves (endpoint, headers, timeout, compression), and the resource honours OTEL_SERVICE_NAME and OTEL_RESOURCE_ATTRIBUTES.
Index ¶
Constants ¶
const BrowserServiceName = "credimi-browser"
BrowserServiceName is the service.name every forwarded batch is given: anyone can post here, so browser data must never pass for backend data.
const BrowserTracesPath = "/api/otlp/v1/traces"
BrowserTracesPath receives OTLP/JSON traces from the webapp's browser SDK. Browsers cannot hold the collector credentials, so Credimi forwards the batches with its own.
const RunnerServiceName = "credimi-runner"
RunnerServiceName is the service.name every forwarded batch is given.
const RunnerTelemetryPath = "/api/otlp/runner/v1/{signal}"
RunnerTelemetryPath receives OTLP/protobuf traces, metrics and logs from credimi-runner, authenticated with the runner's Credimi API key. Credimi forwards them with the collector credentials, so runners hold none.
Variables ¶
This section is empty.
Functions ¶
func Handler ¶
Handler returns next, also sending every record to OpenTelemetry when export is on. Records logged with a context carry its trace and span IDs.
func RecordServerError ¶ added in v1.323.0
RecordServerError records err as an exception on the request span when the response is a server error. Client errors (4xx) are expected and stay as the span's status code only.
func RunnerPreAuthLimit ¶ added in v1.324.0
func RunnerPreAuthLimit() func(*core.RequestEvent) error
RunnerPreAuthLimit throttles runner telemetry per client IP before the API key is verified.
func RunnerTelemetryHandler ¶ added in v1.324.0
func RunnerTelemetryHandler() func(*core.RequestEvent) error
RunnerTelemetryHandler forwards runner OTLP batches. It must sit behind the API key middleware, which sets the key owner as e.Auth.
func Setup ¶
Setup turns OTLP export on when OTEL_EXPORTER_OTLP_ENDPOINT is set. The exporters are flushed on terminate. Every served request is traced: the otelhttp wrapper goes around the final mux, so it also covers the UI and Temporal UI proxies, and the router middleware names each span after the matched route pattern and records the authenticated user and handler errors.
Types ¶
This section is empty.