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.
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 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.