Skip to content

feat!: Switch opencensus for opentelemetry and expand metrics#628

Merged
keelerm84 merged 2 commits intov9from
setup-v9-3
Apr 6, 2026
Merged

feat!: Switch opencensus for opentelemetry and expand metrics#628
keelerm84 merged 2 commits intov9from
setup-v9-3

Conversation

@keelerm84
Copy link
Copy Markdown
Member

@keelerm84 keelerm84 commented Apr 3, 2026


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_OTLP section (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 RelayMetricsCollector for 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.

@keelerm84 keelerm84 requested a review from a team as a code owner April 3, 2026 19:22
@keelerm84 keelerm84 changed the title setup v9 3 feat!: Switch opencensus for opentelemetry and expand metrics Apr 3, 2026
Comment thread internal/metrics/measures.go
Protocol = websocket
`
return c
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Base automatically changed from setup-v9-2 to v9 April 6, 2026 15:43
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)
@keelerm84 keelerm84 merged commit 11c5862 into v9 Apr 6, 2026
6 checks passed
@keelerm84 keelerm84 deleted the setup-v9-3 branch April 6, 2026 15:45
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

Reviewed by Cursor Bugbot for commit 4098046. Configure here.

Comment thread go.mod
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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 4098046. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants