Odyssey

Observability for the supergraph: Best practices for graph-native telemetry

1. Workshop intro2. Welcome Survey3. Enum Value Usage4. Explore Exoplanets5. Operation Insights6. Field & Schema Coordinate Insights7. Performance Bottlenecks Part 18. Performance Bottlenecks Part 29. Router Configuration10. Test your knowledge!11. Adding client identification12. Removing a field13. Wrap Up: Where to next?
9. Router Configuration
1m

Reference: Router Configuration

Review Router configuration to adjust trace sampling to 10% of requests:

router.yaml
telemetry:
exporters:
tracing:
common:
sampler: 0.1 # 10% (default: always_on)
apollo:
field_level_instrumentation_sampler: 0.1 # recommend using the same value as common

Review Router configuration to adjust tracing limits:

router.yaml
telemetry:
exporters:
tracing:
common:
max_attributes_per_event: 32 # default 128
max_attributes_per_link: 32 # default 128
max_attributes_per_span: 32 # default 128
max_events_per_span: 32 # default 128
max_links_per_span: 32 # default 128

Review Router configuration to adjust redaction rules:

router.yaml
telemetry:
apollo:
send_headers: # (default: none)
only:
- user-agent
send_variable_values: # (default: none)
except:
- password
errors:
subgraph:
all:
# By default, subgraphs should report errors with a redacted message
send: true # (default: true)
redact: true # (default: true)

Review Router configuration to turn on recent enhancements:

router.yaml
telemetry:
apollo:
signature_normalization_algorithm: enhanced # default is legacy
metrics_reference_mode: extended # default is legacy
experimental_otlp_tracing_sampler: always_on # default is always_off

Visit the Apollo Docs to learn more.

Previous
Next

Share your questions and comments about this lesson

Your feedback helps us improve! If you're stuck or confused, let us know and we'll help you out. All comments are public and must follow the Apollo Code of Conduct. Note that comments that have been resolved or addressed may be removed.

You'll need a GitHub account to post below. Don't have one? Post in our Odyssey forum instead.

              Router

              The single access point for a federated GraphQL architecture. It receives incoming operations and intelligently routes them across component services before returning a unified response.

              trace

              A record of the journey of a request. It consists of a collection of spans. Same concept as an OpenTelemetry trace.

              Router

              The single access point for a federated GraphQL architecture. It receives incoming operations and intelligently routes them across component services before returning a unified response.

              Router

              The single access point for a federated GraphQL architecture. It receives incoming operations and intelligently routes them across component services before returning a unified response.

              Router

              The single access point for a federated GraphQL architecture. It receives incoming operations and intelligently routes them across component services before returning a unified response.

              NEW COURSE ALERT

              Introducing Apollo Connectors

              Connectors are the new and easy way to get started with GraphQL, using existing REST APIs.

              Say goodbye to GraphQL servers and resolvers—now, everything happens in the schema!

              Take the course