-
Notifications
You must be signed in to change notification settings - Fork 299
Add preview_datadog_agent_sampling
#6112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
a1b638d
001af54
42247b7
7ad4d02
d8bf352
110917c
562b7ac
1776e59
5d1b0b4
9b60c38
16cd222
d7532ce
c91a233
98624c7
067eb56
43aa702
17e88fa
8726737
8909929
1105d31
30ffb13
b8a8e20
4490216
bfeca6e
530eecd
0a1e1f7
e81b5ec
14c3ed6
1c0a232
437f053
e701fda
be68420
1e6b559
55ec86e
3b5d256
0632ee6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
### Respect x-datadog-sampling-priority ([PR #6017](https://github.com/apollographql/router/pull/6017)) | ||
|
||
This PR consists of two fixes: | ||
#### Datadog priority sampling resolution is not lost. | ||
|
||
Previously a `x-datadog-sampling-priority` of `-1` would be converted to `0` for downstream requests and `2` would be converted to `1`. | ||
|
||
#### The sampler option in the `telemetry.exporters.tracing.common.sampler` is not datadog aware. | ||
|
||
To get accurate APM metrics all spans must be sent to the datadog agent with a `psr` or `sampling.priority` attribute set appropriately to record the sampling decision. | ||
|
||
`preview_datadog_agent_sampling` option in the router.yaml enables this behavior and should be used when exporting to the datadog agent via OTLP or datadog native. | ||
|
||
```yaml | ||
telemetry: | ||
exporters: | ||
tracing: | ||
common: | ||
# Only 10 percent of spans will be forwarded from the Datadog agent to Datadog. Experiment to find a value that is good for you! | ||
sampler: 0.1 | ||
# Send all spans to the Datadog agent. | ||
preview_datadog_agent_sampling: true | ||
|
||
# Example OTLP exporter configuration | ||
otlp: | ||
enabled: true | ||
# Optional batch processor setting, this will enable the batch processor to send concurrent requests in a high load scenario. | ||
batch_processor: | ||
max_concurrent_exports: 100 | ||
BrynCooke marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# Example Datadog native exporter configuration | ||
datadog: | ||
enabled: true | ||
|
||
# Optional batch processor setting, this will enable the batch processor to send concurrent requests in a high load scenario. | ||
batch_processor: | ||
max_concurrent_exports: 100 | ||
BrynCooke marked this conversation as resolved.
Show resolved
Hide resolved
|
||
``` | ||
|
||
By using these options, you can decrease your Datadog bill as you will only be sending a percentage of spans from the Datadog agent to datadog. | ||
|
||
> [!IMPORTANT] | ||
> Users must enable `preview_datadog_agent_sampling` to get accurate APM metrics. | ||
|
||
> [!IMPORTANT] | ||
> Sending all spans to the datadog agent may require that you tweak the `batch_processor` settings in your exporter config. This applies to both OTLP and the Datadog native exporter. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we also mention potential perf impacts ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've added some documentation around setting the sampler: |
||
|
||
By [@BrynCooke](https://github.com/BrynCooke) in https://github.com/apollographql/router/pull/6017 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
telemetry: | ||
instrumentation: | ||
spans: | ||
mode: spec_compliant | ||
apollo: | ||
field_level_instrumentation_sampler: 1.0 | ||
exporters: | ||
tracing: | ||
common: | ||
preview_datadog_agent_sampling: true | ||
sampler: 0.5 |
Uh oh!
There was an error while loading. Please reload this page.