The SDK policy governs every exporter; what it can't reach is reported ungoverned

Merged
ST
1mo ago
+11348-2963

Manage in Logfire, send anywhere: a Logfire SDK policy now governs every exporter the SDK exports through, in all five SDKs, instead of being refused (FAILED) or set aside whenever another exporter was present.

What changes

  • Governed: each SDK puts its gate (signal export, log levels, caps, redaction, scrubbing, export health counts) in front of every exporter it can reach. That includes the console, a processor added later, a configuration file's exporters, the Logfire SDK's console and OTLP exporters (Python), NodeSDK's own exporters (Node.js), and another plugin's OTLP exporter (.NET).
  • One decision per item: a span or log record is decided once for every exporter it reaches. A record the log rate cap admits reaches the console and Logfire alike, with one rate cap budget per process.
  • Ungoverned, reported, never refused: what a gate can't be put in front of is listed with gated: false in the inventory and with the status ungoverned (healthy) in export health, and the SDK logs it. Examples: a processor that holds its own exporter, a pulled reader (Prometheus), a global provider of the application's own (app_provider), a non-OTLP exporter in .NET (the .NET gate is the OTLP exporter's HTTP handler). The policy stays APPLIED and in force on everything governed.
  • Exporter identity: inventory keys are name@host:port (otlp@api.honeycomb.io:443), with the metadata destination (scheme://host:port, never a path or credentials). Export health lists every exporter under its signal.
  • Still narrowed: only another sampler in place of the SDK's (Java: another extension's sampler; .NET: a sampler it couldn't wrap; Python: another configurator). Its controls are left undeclared and, if already in force, set aside.
  • Shared end-to-end checks (check_truth): each setup now sends what goes past the gates to a second sink (EXAMPLE_SECOND_SINK). That telemetry must arrive there and be reported ungoverned, and nothing may be set aside except a replaced sampler's settings. Locally, Python late-processor and Go global-tracer pass end to end.
  • Core 0.15.0: the generated settings types and each SDK's test lists include the new optional self_monitoring control (send_self_metrics). No SDK declares it yet, so an override of it is refused and local control is accepted. Declaring it comes in a follow-up.

Spec and our choices

  • No OpAMP protocol change. The inventory stays AvailableComponents and export health stays ComponentHealth children; both are already in the spec.
  • Our choices, where the spec leaves it open: governing every reachable exporter (rather than refusing), the ungoverned health status, exporter identity as name@host:port, and one decision per item shared across exporters.

Before merge

  • Needs the core 0.15.0 prerelease locked in opamp-core.lock.json. It is not locked yet, so CI on the current lock will fail on the new fields.
  • The first commit of this PR's earlier draft (the console exempt from the controls) is superseded by a merge that keeps none of its tree.

šŸ¤– Generated with Claude Code

https://claude.ai/code/session_01RQmH27faBjhx13naTbnizm