feat!: Switch opencensus for opentelemetry and expand metrics#628
feat!: Switch opencensus for opentelemetry and expand metrics#628
Conversation
| Protocol = websocket | ||
| ` | ||
| return c | ||
| } |
There was a problem hiding this comment.
Test missing fileError for OTLP invalid protocol validation
Low Severity
makeInvalidConfigOTLPInvalidProtocol provides fileContent with an invalid protocol but doesn't set fileError. The test framework falls back to envVarsError when fileError is empty, so the test still runs. However, every other invalid config test that has both fileContent and a validation error explicitly sets fileError when appropriate, making this inconsistency easy to miss during maintenance. It's a minor gap in test clarity rather than a test failure.
Replaces the opencensus metrics implementation with opentelemetry, removes the deprecated "new connections" usage metric, and expands the supported OTEL metric instruments. Includes: - chore: Set next release as rc.1 (#578) - feat!: Switch opencensus for opentelemetry (#583) - feat: Remove "new connections" usage metric (#595) - chore: Clean up doc (#596) - feat: Expand supported OTEL metrics (#597)
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
Reviewed by Cursor Bugbot for commit 4098046. Configure here.
| go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.40.0 | ||
| go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.40.0 | ||
| go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.40.0 | ||
| go.opentelemetry.io/otel/exporters/prometheus v0.62.0 |
There was a problem hiding this comment.
Unused OTel trace and Prometheus exporter dependencies added
Low Severity
The go.mod adds otlptracegrpc, otlptracehttp, and go.opentelemetry.io/otel/exporters/prometheus as direct dependencies, but none of these packages are imported anywhere in the new code. Only the metric exporters (otlpmetricgrpc, otlpmetrichttp) are actually used in otlp.go. The old Prometheus exporter code (prometheus.go) was deleted and not replaced with an OTel Prometheus exporter. These unused direct dependencies increase the dependency graph and binary size for no reason.
Reviewed by Cursor Bugbot for commit 4098046. Configure here.


Note
High Risk
Replaces the existing OpenCensus-based metrics/exporter stack with new OpenTelemetry OTLP instrumentation and middleware, plus adds new unauthenticated per-environment status routes; these are cross-cutting runtime/observability changes with potential compatibility and operational impact.
Overview
Switches metrics from OpenCensus/Datadog/Stackdriver/Prometheus exporters to OpenTelemetry OTLP. Configuration is replaced with a new
[OpenTelemetry]/USE_OTLPsection (endpoint/protocol/headers/serviceName), adds protocol validation, and updates docs/README accordingly.Reworks metrics instrumentation and HTTP middleware. Metrics now include request duration and ingested event bytes, add richer request attributes (route/method/app/instance IDs), remove “new connections” counters, and replace the OpenCensus view pipeline with an internal
RelayMetricsCollectorfor relayMetrics events.Adds granular status endpoints. Introduces
GET /status/{identifier}and/status/{projKey}/{envKey}variants (with optional/filters/{filterKey}), refactors shared status-building logic, and refreshes environment indexes when identifiers change in autoconfig.Also bumps Go to
1.25, updates dependencies (notably Prometheus client + OpenTelemetry libs), adjusts/modernizes several tests, and removes the CI Prometheus endpoint check.Reviewed by Cursor Bugbot for commit 4098046. Bugbot is set up for automated code reviews on this repo. Configure here.