Skip to content

feat: Add startup warning for OTEL_EXPORTER_OTLP_ENDPOINT environment…#8729

Merged
abernix merged 5 commits intodevfrom
ROUTER-1497/otel-endpoint-env-warning
Dec 12, 2025
Merged

feat: Add startup warning for OTEL_EXPORTER_OTLP_ENDPOINT environment…#8729
abernix merged 5 commits intodevfrom
ROUTER-1497/otel-endpoint-env-warning

Conversation

@apollo-mateuswgoettems
Copy link
Contributor

@apollo-mateuswgoettems apollo-mateuswgoettems commented Dec 5, 2025


Description

This PR adds a startup warning to alert users when the OTEL_EXPORTER_OTLP_ENDPOINT environment variable is set.

The warning message informs users that this environment variable takes precedence over default router configurations and may override trace export to Apollo Studio, which could cause unexpected behavior in telemetry collection.

Motivation

Users may accidentally set OTEL_EXPORTER_OTLP_ENDPOINT globally or in their deployment configuration without realizing it takes precedence over the router's configured telemetry settings. This can silently redirect traces away from Apollo Studio, making it difficult to diagnose why traces are not appearing.

Changes

  • Added environment variable check in apollo-router/src/executable.rs during router startup
  • Displays a warning log message when OTEL_EXPORTER_OTLP_ENDPOINT is detected
  • Warning is only shown when the variable is actually set (no unnecessary warnings)

Checklist

Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.

  • PR description explains the motivation for the change and relevant context for reviewing
  • PR description links appropriate GitHub/Jira tickets (creating when necessary)
  • Changeset is included for user-facing changes
  • Changes are compatible[^1]
  • Documentation[^2] completed
  • Performance impact assessed and acceptable
  • Metrics and logs are added[^3] and documented
  • Tests added and passing[^4]
    • Unit tests
    • Integration tests
    • Manual tests, as necessary

Exceptions

  • Documentation: This is a simple startup warning message. No additional documentation is required as the warning itself is self-explanatory.
  • Performance impact: Negligible - only a single env::var() check during startup (one-time operation).
  • Tests: Manual testing required to verify warning appears when variable is set.

Testing

Manual Testing

To verify this change:

  1. Start the router with the environment variable set:
    OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317 cargo run -- -s supergraph.graphql
    

@apollo-mateuswgoettems apollo-mateuswgoettems requested a review from a team December 5, 2025 17:57
@apollo-mateuswgoettems apollo-mateuswgoettems requested a review from a team as a code owner December 5, 2025 17:57
@apollo-librarian
Copy link

apollo-librarian bot commented Dec 5, 2025

✅ Docs preview ready

The preview is ready to be viewed. View the preview

File Changes

0 new, 10 changed, 0 removed
* graphos/routing/(latest)/configuration/yaml.mdx
* graphos/routing/(latest)/customization/native-plugins.mdx
* graphos/routing/(latest)/performance/caching/response-caching/customization.mdx
* graphos/routing/(latest)/performance/caching/response-caching/faq.mdx
* graphos/routing/(latest)/performance/caching/response-caching/invalidation.mdx
* graphos/routing/(latest)/performance/caching/response-caching/observability.mdx
* graphos/routing/(latest)/performance/caching/response-caching/overview.mdx
* graphos/routing/(latest)/performance/caching/response-caching/quickstart.mdx
* graphos/routing/(latest)/upgrade/from-router-v1.mdx
* graphos/routing/(latest)/federation-version-support.mdx

Build ID: bce0d0a11966d1959e89eea3
Build Logs: View logs

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

Copy link
Contributor

@bonnici bonnici left a comment

Choose a reason for hiding this comment

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

Looks good to me but what's the reason for adding the new schema.json file? We may need to get someone from the router team to take a look at that one.

@apollo-mateuswgoettems
Copy link
Contributor Author

Apologies, I was testing something earlier with schema.json and accidentally left it in. It has now been removed.

@abernix abernix enabled auto-merge (squash) December 11, 2025 15:28
@abernix abernix merged commit 2450faa into dev Dec 12, 2025
15 checks passed
@abernix abernix deleted the ROUTER-1497/otel-endpoint-env-warning branch December 12, 2025 22:03
briannafugate408 pushed a commit that referenced this pull request Jan 9, 2026
…t… (#8729)

Co-authored-by: Jesse Rosenberger <git@jro.cc>
briannafugate408 pushed a commit that referenced this pull request Jan 21, 2026
…t… (#8729)

Co-authored-by: Jesse Rosenberger <git@jro.cc>
@abernix abernix mentioned this pull request Jan 27, 2026
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.

3 participants