Skip to content

refactor(telemetry): remove legacy Apollo protobuf trace export path#9819

Open
rregitsky wants to merge 12 commits into
dev-v3.xfrom
rreg/ROUTER-1804/remove-legacy-tracing-path
Open

refactor(telemetry): remove legacy Apollo protobuf trace export path#9819
rregitsky wants to merge 12 commits into
dev-v3.xfrom
rreg/ROUTER-1804/remove-legacy-tracing-path

Conversation

@rregitsky

@rregitsky rregitsky commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Removes the legacy Apollo protobuf trace export path. Router 3.0 exports traces to GraphOS exclusively via OTLP, so the old protobuf-over-HTTP transport and the telemetry.apollo.otlp_tracing_sampler option that selected between the two transports are no longer needed.

Usage report metrics are unaffected: ApolloExporter and telemetry.apollo.endpoint remain in place and continue to use the Apollo usage reporting protocol.

Changes

  • refactor(telemetry)! — remove the report_exporter branch, the protobuf trace-tree building in apollo_telemetry.rs, and the now-dead trace submission logic in ApolloExporter. Drops the telemetry.apollo.otlp_tracing_sampler config option. (Also removes the now-unused CacheControl::public() accessor, which was only reachable from the deleted trace-building path.)
  • feat(config) — add config migration 3002-remove-legacy-tracing.yaml. Configs still setting otlp_tracing_sampler are upgraded automatically at startup with a warning instead of failing deny_unknown_fields validation.
  • test(telemetry) — drop the legacy protobuf trace-report tests and snapshots from apollo_reports.rs. Equivalent OTLP coverage already lives in apollo_otel_traces.rs. Metrics/stats report tests are unchanged. (test_demand_control_trace had no OTLP counterpart; demand-control coverage remains via test_demand_control_stats.)
  • docs — remove otlp_tracing_sampler references and update the GraphOS reporting docs.

Migration

An automatic configuration migration deletes telemetry.apollo.otlp_tracing_sampler on startup and logs a warning. To sample traces sent to GraphOS, use telemetry.apollo.sampler or the common tracing sampler instead.

Notes

  • Targets dev-v3.x (Router 3.0 line).

@rregitsky
rregitsky requested a review from a team as a code owner July 16, 2026 14:29
@apollo-librarian

apollo-librarian Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

✅ Docs preview ready

The preview is ready to be viewed. View the preview

File Changes

1 new, 19 changed, 0 removed
+ graphos/routing/(latest)/upgrade/from-router-v2.mdx
* graphos/routing/(latest)/configuration/yaml.mdx
* graphos/routing/(latest)/customization/native-plugins.mdx
* graphos/routing/(latest)/customization/coprocessor/index.mdx
* graphos/routing/(latest)/observability/graphos/graphos-reporting.mdx
* graphos/routing/(latest)/observability/router-telemetry-otel/index.mdx
* graphos/routing/(latest)/observability/router-telemetry-otel/apm-guides/datadog/router-instrumentation.mdx
* graphos/routing/(latest)/observability/router-telemetry-otel/apm-guides/datadog/connecting-to-datadog/datadog-agent/datadog-agent-traces.mdx
* graphos/routing/(latest)/observability/router-telemetry-otel/apm-guides/jaeger/jaeger-traces.mdx
* graphos/routing/(latest)/observability/router-telemetry-otel/apm-guides/zipkin/zipkin-traces.mdx
* graphos/routing/(latest)/observability/router-telemetry-otel/enabling-telemetry/conditions.mdx
* graphos/routing/(latest)/observability/router-telemetry-otel/enabling-telemetry/selectors.mdx
* graphos/routing/(latest)/observability/router-telemetry-otel/enabling-telemetry/spans.mdx
* graphos/routing/(latest)/observability/router-telemetry-otel/enabling-telemetry/standard-instruments.mdx
* graphos/routing/(latest)/observability/router-telemetry-otel/telemetry-pipelines/trace-exporters/overview.mdx
* graphos/routing/(latest)/performance/caching/response-caching/faq.mdx
* graphos/routing/(latest)/query-planning/caching.mdx
* graphos/routing/(latest)/security/demand-control.mdx
* graphos/routing/(latest)/upgrade/from-router-v1.mdx
* graphos/routing/(latest)/_sidebar.yaml

Build ID: 0df53a184b13ea5cb39ea478
Build Logs: View logs

URL: https://www.apollographql.com/docs/deploy-preview/0df53a184b13ea5cb39ea478


⚠️ AI Style Review — 11 Issues Found

Summary

The pull request updates documentation to align with style guide standards across several key areas. Changes to products and features ensure standalone product names like Router and Apollo Usage Reporting are used without articles or possessives. Structural improvements include using imperative verbs for headings in tutorials, formatting list introductions with colons, and omitting punctuation for fragment list items. Text formatting was standardized by applying v#.#.# format to version numbers, replacing double quotes with code font for symbols, and removing bold emphasis. Voice and framing were refined to be more authoritative, reader-centric (using 'you'), and prescriptive, while verb tense and word usage were updated to favor the active voice, present tense, Oxford commas, and standard contractions.

Duration: 3847ms
Review Log: View detailed log

This review is AI-generated. Please use common sense when accepting these suggestions, as they may not always be accurate or appropriate for your specific context.

Router 3 exports traces to GraphOS exclusively via OTLP. Removes the
telemetry.apollo.otlp_tracing_sampler config option, the report_exporter
branch and protobuf trace-tree building in apollo_telemetry.rs, and the
now-dead trace submission logic in ApolloExporter. ApolloExporter and
telemetry.apollo.endpoint remain in place for usage report metrics.
…_sampler

Configs that still set the key are upgraded automatically at startup
with a warning instead of failing deny_unknown_fields validation.
The legacy protobuf trace path is gone, so the trace-report assertions
in apollo_reports.rs and their snapshots are removed. Equivalent OTLP
coverage lives in apollo_otel_traces.rs. Metrics and stats report tests
are unchanged. Note test_demand_control_trace had no direct OTLP
counterpart; demand control coverage remains via test_demand_control_stats.
@rregitsky
rregitsky force-pushed the rreg/ROUTER-1804/remove-legacy-tracing-path branch from 808bb4a to 2b12f84 Compare July 16, 2026 14:43
Comment thread apollo-router/src/plugins/response_cache/cache_control.rs
Comment thread apollo-router/src/plugins/telemetry/tracing/apollo.rs
Comment thread apollo-router/src/plugins/telemetry/tracing/apollo_telemetry.rs Outdated
Comment thread apollo-router/src/plugins/telemetry/tracing/apollo_telemetry.rs
Comment thread apollo-router/src/plugins/telemetry/tracing/apollo_telemetry.rs
Comment thread apollo-router/src/plugins/telemetry/apollo_exporter.rs
Comment thread docs/source/routing/upgrade/from-router-v1.mdx Outdated
rregitsky and others added 6 commits July 16, 2026 13:31
The reports fixtures previously set otlp_tracing_sampler: always_off to keep
the usage-reporting tests from exporting traces to an unmocked OTLP endpoint.
That key was removed, so use the new per-exporter telemetry.apollo.sampler
instead. These fixtures are shared with apollo_otel_traces and
apollo_otel_http_proxy, which mock the OTLP collector and do want traces, so
those suites override the sampler back to always_on.
Router v1.49-1.60 spelled the key experimental_otlp_tracing_sampler before it
was renamed to otlp_tracing_sampler. The removal migration now warns and
deletes both spellings so a config still using the older name is upgraded
cleanly instead of failing validation.
The trace-reporting example set telemetry.apollo.sampler above the common
sampler, which the router rejects at startup; lower it below the common
sampler and correct the comment to describe the absolute-fraction semantics.
Move the v3.x otlp_tracing_sampler removal note out of the 1.x-to-2.x upgrade
guide (where the key is renamed, not removed) into the 2.x-to-3.x guide.
The 429 rate-limit backoff was unreachable: 429 is consumed by the
is_client_error branch, so the studio_backoff writer under is_server_error
never ran and the backoff gate never engaged. Remove the StudioBackoff error
variant, the studio_backoff field, the pre-submit gate, and the trace-era
retry loop that no longer applies now that traces do not use this path.

SingleReport had a single Stats variant wrapping SingleStatsReport; every
producer wrapped and every consumer unwrapped it. Collapse it to
SingleStatsReport directly.

Document in the changeset that the free-plan traces-ignored warning and the
trace retry are gone (OTLP owns retry); reinstating the warning is ROUTER-1999.
- Make the attribute/event allowlists non-optional (they were always Some),
  removing the unreachable None arms including a keep-all-attributes branch
  that would have forwarded un-vetted attributes to Apollo.
- Run the ftv1 decode/re-encode after releasing the span_cache lock instead
  of while holding it.
- Inline the group_by_trace pass-through into pop_spans_for_tree.
- Rename the builder args to endpoint and tracing_protocol now that the
  legacy alternatives are gone.
Split the apollo_telemetry test imports to one-per-line to satisfy the
repo's imports_granularity=Item rustfmt config, and remove the now-unused
apollo module import left behind by the SingleReport collapse.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment thread apollo-router/src/configuration/migrations/3002-remove-legacy-tracing.yaml Outdated
Comment thread .changesets/breaking_rreg_router_1804_remove_legacy_apollo_tracing.md Outdated
…lan note

The experimental_otlp_tracing_sampler warn+delete in 3002 is unreachable on
a supported upgrade: no migration renames the experimental spelling on this
branch (the 1.x-only 0032 move was never carried into the 2.x/3.x set), and a
major-by-major upgrade already renames it to otlp_tracing_sampler at the 1->2
step, so a 3.x config only ever carries the stable spelling. Remove the extra
handling plus its testdata fixture and snapshot.

Also drop the free-plan trace-suppression note from the changeset. Free plans
are not traced by GraphOS, but that signal only ever reached the router via the
removed legacy ingress response (tracesIgnored); it has no OTLP equivalent, so
the warning cannot be trivially reinstated. The trace-specific retry removal is
behavior-neutral on the OTLP path. Both are release-note noise.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rregitsky rregitsky changed the title refactor(telemetry)!: remove legacy Apollo protobuf trace export path refactor(telemetry): remove legacy Apollo protobuf trace export path Jul 16, 2026
@bonnici
bonnici requested a review from Copilot July 16, 2026 20:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

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