Skip to content

Migrate Google Cloud Trace export to OTLP protobuf - #1069

Merged
cmraible merged 1 commit into
mainfrom
codex/cloud-trace-otlp
Nov 16, 2026
Merged

cmraible merged 1 commit into
mainfrom
codex/cloud-trace-otlp

Conversation

@cmraible

@cmraible cmraible commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

no refs

Note: this is a tracing only change; no user-facing changes expected.

Summary

The deprecated Google Cloud Trace exporter requires OpenTelemetry SDK 2.x and blocks the SDK 3 migration. Export GCP traces directly to the Telemetry API using OTLP HTTP/protobuf, with ADC headers refreshed for each export and the ADC project ID attached as a resource attribute.

 Cloud Run / OTEL_TRACE_EXPORTER=gcp
-  Google Cloud Trace exporter → Cloud Trace API
+  OTLP protobuf exporter + ADC → telemetry.googleapis.com/v1/traces

This is the exporter migration proposed before the coordinated OpenTelemetry upgrades in #1019, #1021 and #1059.

Evidence

  • Before — the removed exporter declares SDK 2.x peer dependencies and its dependency tree fails resolving @opentelemetry/core/package.json with SDK 3 in #1021 CI.
  • After — Docker builds pass. Production image health checks pass with local and Cloud Run configuration. Docker type checking, lint and all 623 unit/integration tests pass, with coverage thresholds met. New tests cover exporter selection, asynchronous project resolution, refreshed ADC headers and authentication failures.

Merge Danger

Door — two-way. Reverting restores the previous exporter.

Blast Radius — tracing.

Before rollout, enable telemetry.googleapis.com and grant the runtime service account roles/telemetry.tracesWriter on the destination project. If ADC specifies a quota project, grant roles/serviceusage.serviceUsageConsumer there too.

Live trace delivery remains unverified. Deploy to staging, send a request, and confirm the trace arrives in Cloud Trace before promoting. OTLP preserves resource and span attribute names, so check queries that relied on the legacy exporter's attribute remapping.

Google migration instructions

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The GCP trace export path now uses the OTLP protobuf exporter and Google authentication. It targets Google’s telemetry endpoint and adds the GCP project ID to resource attributes. Unit tests cover the GCP path, local Jaeger export, custom OTLP configuration, and authentication headers. The architecture documentation describes the endpoint, required permissions, and staging verification.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Refactor

Suggested reviewers: evanhahn

Merge Risk: Minimal · up to 16d69

The OTLP migration appears mergeable after normal checks. Configure the documented Google API permissions and verify trace delivery in staging before production rollout.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: Google Cloud Trace export moves from the deprecated exporter to OTLP protobuf. The raw summary shows the GCP path in src/utils/instrumentation.ts now uses OTLPProtoTra…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description states the PR migrates GCP trace export from the deprecated Google Cloud Trace exporter to OTLP HTTP/protobuf sent to telemetry.googleapis.com, with ADC headers refreshed per export an…
Full details: Title check

Explanation

The title names the main change: Google Cloud Trace export moves from the deprecated exporter to OTLP protobuf. The raw summary shows the GCP path in src/utils/instrumentation.ts now uses OTLPProtoTraceExporter and package.json swaps the exporter dependency, so the title matches the changeset.

Full details: Description check

Explanation

The description states the PR migrates GCP trace export from the deprecated Google Cloud Trace exporter to OTLP HTTP/protobuf sent to telemetry.googleapis.com, with ADC headers refreshed per export and the ADC project ID added as a resource attribute. It also lists test results, Docker checks, and rollout steps (Telemetry API enablement, IAM roles, staging verification). This matches the changeset summary, so the description is related and specific.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3610fed0-e07b-4aa7-b99e-f3a73111104f
Commits

Reviewing files that changed from the base of the PR and between 9594aea and 16d69be.

Files ignored due to path filters: 1

  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing: 4

  • docs/architecture.md
  • package.json
  • src/utils/instrumentation.ts
  • test/unit/utils/instrumentation.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@codecov-commenter

codecov-commenter commented Nov 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@9594aea). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1069   +/-   ##
=======================================
  Coverage        ?   96.13%           
=======================================
  Files           ?       49           
  Lines           ?     1189           
  Branches        ?      206           
=======================================
  Hits            ?     1143           
  Misses          ?       46           
  Partials        ?        0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown

✅ Deployed to staging (tree: 98f5fdc1b7992e5c7c78871cca6e3dfef753e44d)

@github-actions

Copy link
Copy Markdown

✅ Deployed to staging (tree: 98f5fdc1b7992e5c7c78871cca6e3dfef753e44d)

@github-actions

Copy link
Copy Markdown

✅ Deployed to staging (tree: 98f5fdc1b7992e5c7c78871cca6e3dfef753e44d)

@cmraible
cmraible marked this pull request as ready for review November 16, 2026 18:07
@cmraible
cmraible merged commit f2b10f7 into main Nov 16, 2026
27 checks passed
@cmraible
cmraible deleted the codex/cloud-trace-otlp branch November 16, 2026 18:34
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