observability

package
v1.324.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2026 License: AGPL-3.0 Imports: 42 Imported by: 0

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

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

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

View Source
const RunnerServiceName = "credimi-runner"

RunnerServiceName is the service.name every forwarded batch is given.

View Source
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 Enabled

func Enabled() bool

Enabled reports whether Setup turned OTLP export on.

func Handler

func Handler(next slog.Handler) slog.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

func RecordServerError(ctx context.Context, err error, status int)

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

func Setup(app core.App)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL