Skip to content

[Observability] Add production-safe sampling and OTLP export primitives #554

@cssbruno

Description

@cssbruno

Problem

GOWDK has useful tracing primitives, but production export/sampling controls are still too thin for a safe default toolbox.

Verified in this checkout:

  • runtime/trace has AlwaysOn, AlwaysOff, and deterministic RatioSampler.
  • The sampling context includes trace ID and parent span ID, but there is no parent-based sampler helper or route/endpoint-specific override policy.
  • The nested runtime/trace/otel bridge exposes endpoint, insecure mode, headers, batcher-backed export, and Shutdown.
  • The bridge does not expose ForceFlush, queue/batch sizing, retry/backoff controls, compression, TLS options beyond insecure/default TLS, or resource attributes such as service name/version/environment.

Acceptance criteria

  • Add parent-based deterministic ratio sampling primitives.
  • Add generated/app-owned route or endpoint override hooks for health checks, noisy endpoints, and high-value endpoints.
  • Expose bounded export queue and batch configuration, or document how apps supply an owned OpenTelemetry provider when they need that control.
  • Define overflow/drop behavior and surface dropped/exporter-failure counters.
  • Add bounded retry/backoff controls where GOWDK owns export, or explicitly delegate them to the app-owned provider path.
  • Expose ForceFlush in addition to Shutdown.
  • Support TLS/header/compression/resource attributes needed for common OTLP deployments.
  • Document the split between GOWDK-owned stable primitives and app-owned sampling policy/telemetry backend selection.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestobservabilityGOWDK Trace: built-in tracing and observability workruntimeGOWDK Runtime packages and server behavior

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions