Skip to content

Commit

Permalink
docs: trace sampling probability (#5129)
Browse files Browse the repository at this point in the history
  • Loading branch information
shorgi committed May 14, 2024
1 parent 0bcff8b commit 61a1257
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions docs/source/configuration/telemetry/apollo-telemetry.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,17 @@ Your subgraph libraries must support federated tracing (also known as FTV1 traci
- Consult your library's documentation to learn how to enable federated tracing.
- If you use Apollo Server with `@apollo/subgraph`, federated tracing support is enabled automatically.

### Trace sampling rate
### Subgraph trace sampling

By default, the Apollo Router requests subgraph trace data for 1% of operations. In most cases, this provides a sufficient sample size while minimizing latency for most operations (traces can affect latency because they increase the size of subgraph response payloads).
By default, the Apollo Router requests subgraph trace data from operations with a 1% sampling probability per operation. In most cases, this provides a sufficient sample size while minimizing latency for most operations (traces can affect latency because they increase the size of subgraph response payloads).

You can customize your router's trace sampling rate by setting the following options in your [YAML config file](./overview/#yaml-config-file):
You can customize your router's trace sampling probability by setting the following options in your [YAML config file](./overview/#yaml-config-file):

```yaml title="router.yaml"
telemetry:
apollo:
# In this example, the router will request traces for 50% of requests.
# In this example, the trace sampler is configured
# with a 50% probability of sampling a request.
# This value can't exceed the value of tracing.common.sampler.
field_level_instrumentation_sampler: 0.5

Expand Down

0 comments on commit 61a1257

Please sign in to comment.