mirror of
https://github.com/agent-substrate/substrate.git
synced 2026-10-03 03:48:23 +08:00
Fixes #1877 `newMeterProvider` always installed the OTLP periodic reader, so a deployment that scrapes the components' Prometheus endpoints could not stop the push and received every instrument twice. `OTEL_METRICS_EXPORTER` now accepts `otlp` (the default) and `none`, and warns on any other value and keeps OTLP, like `OTEL_LOGS_EXPORTER`. With `none` the OTLP reader is skipped and the Prometheus reader stays. atecontroller moves to a new `serverboot.InitMetricsBridged`: with OTLP it bridges controller-runtime's registry onto the push and keeps the OTel instruments off that registry; with `none` it registers `ate.workerpool.*` on that registry so the manager's `:8080` serves them. Its optional producer wrapper applies on the OTLP path only, where atecontroller keeps padding empty exponential histograms for the Telemetry API. ateom is unchanged apart from honoring the variable. Documented in `docs/observability.md` ("Scraping instead of pushing"). - [x] Tests pass (`internal/serverboot`: value resolution and the warning; `InitMetrics` dials by default and not with `none`; `InitMetricsBridged` pushes the bridged family and the OTel instrument exactly once to a fake OTLP collector without registering the instrument on the bridged registry, collects through the producer wrapper, and with `none` serves both from that registry without dialing) - [x] Appropriate changes to documentation are included in the PR