refactor(telemetry): remove legacy Apollo protobuf trace export path#9819
refactor(telemetry): remove legacy Apollo protobuf trace export path#9819rregitsky wants to merge 12 commits into
Conversation
✅ Docs preview readyThe preview is ready to be viewed. View the preview File Changes 1 new, 19 changed, 0 removedBuild ID: 0df53a184b13ea5cb39ea478 URL: https://www.apollographql.com/docs/deploy-preview/0df53a184b13ea5cb39ea478
|
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.
808bb4a to
2b12f84
Compare
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>
…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>
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_sampleroption that selected between the two transports are no longer needed.Usage report metrics are unaffected:
ApolloExporterandtelemetry.apollo.endpointremain in place and continue to use the Apollo usage reporting protocol.Changes
refactor(telemetry)!— remove thereport_exporterbranch, the protobuf trace-tree building inapollo_telemetry.rs, and the now-dead trace submission logic inApolloExporter. Drops thetelemetry.apollo.otlp_tracing_samplerconfig option. (Also removes the now-unusedCacheControl::public()accessor, which was only reachable from the deleted trace-building path.)feat(config)— add config migration3002-remove-legacy-tracing.yaml. Configs still settingotlp_tracing_samplerare upgraded automatically at startup with a warning instead of failingdeny_unknown_fieldsvalidation.test(telemetry)— drop the legacy protobuf trace-report tests and snapshots fromapollo_reports.rs. Equivalent OTLP coverage already lives inapollo_otel_traces.rs. Metrics/stats report tests are unchanged. (test_demand_control_tracehad no OTLP counterpart; demand-control coverage remains viatest_demand_control_stats.)docs— removeotlp_tracing_samplerreferences and update the GraphOS reporting docs.Migration
An automatic configuration migration deletes
telemetry.apollo.otlp_tracing_sampleron startup and logs a warning. To sample traces sent to GraphOS, usetelemetry.apollo.sampleror the common tracing sampler instead.Notes
dev-v3.x(Router 3.0 line).