-
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
Merged
Merged
Changes from 10 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
a1b638d
Add `experimental_datadog_agent_sampling`
001af54
Merge branch 'dev' into bryn/datadog-agent-support
BrynCooke 42247b7
Update docs
7ad4d02
Update docs
d8bf352
Update docs
110917c
Update docs
562b7ac
Split the changelogs
1776e59
Remove commented out code for auto enabling sampling
5d1b0b4
Merge branch 'dev' into bryn/datadog-agent-support
BrynCooke 9b60c38
Update docs to indicate that preview datadog agent sampling will NOT …
16cd222
Update docs/source/configuration/telemetry/exporters/tracing/datadog.mdx
BrynCooke d7532ce
Update docs/source/configuration/telemetry/exporters/tracing/datadog.mdx
BrynCooke c91a233
Apply suggestions from code review
BrynCooke 98624c7
Apply suggestions from code review
BrynCooke 067eb56
Merge branch 'dev' into bryn/datadog-agent-support
BrynCooke 43aa702
Merge dev
17e88fa
Merge remote-tracking branch 'public/dev' into bryn/datadog-agent-sup…
abernix 8726737
Merge branch 'dev' into bryn/datadog-agent-support
BrynCooke 8909929
Merge branch 'dev' into bryn/datadog-agent-support
BrynCooke 1105d31
Merge branch 'dev' into bryn/datadog-agent-support
BrynCooke 30ffb13
Improve datadog and otlp sampling tests
b8a8e20
Merge branch 'dev' into bryn/datadog-agent-support
BrynCooke 4490216
Lint and test fixes
bfeca6e
Improve integration tester
530eecd
Fix coprocessor test
0a1e1f7
Fix redis test
e81b5ec
Merge dev
14c3ed6
Lint
1c0a232
Lint
437f053
Fix a couple of new tests from merge
e701fda
Make test less flaky
be68420
Revert change to propagator order
1e6b559
Add test for custom propagation overriding the DD propagator
55ec86e
Add test and fix datadog propagator to fall back to the span sampling…
3b5d256
Add test for non datadog agent propagation zero percent sampling.
0632ee6
Improve trace_id test
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
### Add `preview_datadog_agent_sampling` ([PR #6017](https://github.com/apollographql/router/pull/6017)) | ||
|
||
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 | ||
|
||
|
||
``` | ||
|
||
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. | ||
BrynCooke marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
> [!IMPORTANT] | ||
> Users must enable `preview_datadog_agent_sampling` to get accurate APM metrics. Users that have been using recent versions of the router will have to modify their configuration to retain full APM metrics. | ||
|
||
> [!IMPORTANT] | ||
> The Router does not support [`in-agent` ingestion control](https://docs.datadoghq.com/tracing/trace_pipeline/ingestion_mechanisms/?tab=java#in-the-agent). | ||
> Configuring `traces_per_second` in the Datadog agent will NOT dynamically adjust the Router's sampling rate to meet the target rate. | ||
BrynCooke marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
> [!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. | ||
BrynCooke marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
See the updated Datadog tracing documentation for more information on configuration options and their implications. | ||
BrynCooke marked this conversation as resolved.
Show resolved
Hide resolved
|
7 changes: 7 additions & 0 deletions
7
.changesets/fix_bryn_datadog_upstream_sampling_decision_propagation.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
### Datadog priority sampling resolution is lost ([PR #6017](https://github.com/apollographql/router/pull/6017)) | ||
|
||
Previously a `x-datadog-sampling-priority` of `-1` would be converted to `0` for downstream requests and `2` would be converted to `1`. | ||
This means that when propagating to downstream services a value of USER_REJECT would be transmitted as AUTO_REJECT. | ||
|
||
This PR fixes this by ensuring that the `x-datadog-sampling-priority` is transmitted as is to downstream services. | ||
BrynCooke marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...lo-router/src/plugins/telemetry/testdata/config.field_instrumentation_sampler.router.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.