mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-12 19:32:48 -06:00
12b7290697
* distributedtracing: export Prometheus metrics via OTLP Add support for pushing OPA's existing Prometheus metrics to an OpenTelemetry collector via OTLP, eliminating the need for a dedicated scraper sidecar. Uses the OTel Prometheus bridge to read from OPA's prometheus.Registry and export through an OTLP metric exporter (gRPC or HTTP), reusing the same address and TLS configuration as traces. New config fields: distributed_tracing.metrics (bool, default false) and distributed_tracing.metrics_export_interval_ms (int, default 60000). Fixes #7591 Signed-off-by: Michael Munch <mm.munk@gmail.com> * metricsexport: decouple metrics export into top-level config section Extract metrics export from distributed_tracing into its own metrics_export config section with independent type (otlp/grpc, otlp/http), address, and TLS settings. This allows exporting Prometheus metrics via OTLP without enabling tracing, and to a different endpoint than traces. - Extract shared TLS helpers into internal/tlsutil - Add MetricsExport field to top-level Config - Create internal/metricsexport package with Init, config parsing - Remove metrics fields from distributedtracing - Update runtime to call metricsexport.Init separately - Move e2e tests to v1/test/e2e/metricsexport - Add Metrics Export section to configuration docs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Michael Munch <mm.munk@gmail.com> * ci: retrigger checks Signed-off-by: Michael Munch <mm.munk@gmail.com> * go.mod: upgrade dependencies downgraded during rebase Modules like containerd, go-sqlbuilder, OpenTelemetry, and golang.org/x/* were at older versions than main after a rebase. Upgrade them to match or exceed main. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Michael Munch <mm.munk@gmail.com> * Update internal/distributedtracing/distributedtracing_test.go Signed-off-by: Michael Munch <mm.munk@gmail.com> --------- Signed-off-by: Michael Munch <mm.munk@gmail.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>