Skip to content
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

Add Dynatrace sampler to OpenTelemetry Tracing Provider #50202

Merged
merged 7 commits into from
Apr 2, 2024

Conversation

joaopgrassi
Copy link
Member

@joaopgrassi joaopgrassi commented Apr 2, 2024

Please provide a description of this PR:

Closes #50001

This is a follow up on the recent API change to allow configuring custom Samplers to the OpenTelemetry Tracing Provider in Istio. istio/api#3134

This PR then uses this new API config and allow configuring the first custom sampler, the Dynatrace sampler. A bit of context: Today, there's multiple ways to configure sampling in Istio, which works/have the following precedence:

telemetry.RandomSamplingPercentage > defaultConfig.tracing.sampling > PILOT_TRACE_SAMPLING

This PR adds another option, changing the order above to:

provider.sampler > telemetry.RandomSamplingPercentage > defaultConfig.tracing.sampling > PILOT_TRACE_SAMPLING

Which means:

  • If OpenTelemetryTracingProvider has a custom sampler configured (what this PR adds):

    • Set telemetry.RandomSamplingPercentage to 100 as all spans should arrive on the sampler, so it can perform its algorithm. This is hardcoded and the user cannot change (doesn't make sense to). Without all spans a sampler can't make consistent sampling decisions.
  • Else, continue with the same precedence as today. Essentially nothing changes when users don't use a Sampler:

 telemetry.RandomSamplingPercentage > defaultConfig.tracing.sampling > PILOT_TRACE_SAMPLING

cc @howardjohn @zirain

I plan to add a new documentation page to explain how the ways sampling can be configured when using the OpenTelemetry tracer in Istio.

@istio-testing
Copy link
Collaborator

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@istio-testing istio-testing added do-not-merge/work-in-progress Block merging of a PR because it isn't ready yet. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 2, 2024
@joaopgrassi
Copy link
Member Author

/test all

@joaopgrassi
Copy link
Member Author

/test all

@joaopgrassi joaopgrassi marked this pull request as ready for review April 2, 2024 16:08
@joaopgrassi joaopgrassi requested a review from a team as a code owner April 2, 2024 16:08
@istio-testing istio-testing removed the do-not-merge/work-in-progress Block merging of a PR because it isn't ready yet. label Apr 2, 2024
@joaopgrassi
Copy link
Member Author

Hi @howardjohn @zirain this is the implementation of samplers we have been talking. It would be great if we can get this in time for the 1.22 release. Thank you!

@istio-testing istio-testing merged commit f2c4aa4 into istio:master Apr 2, 2024
29 checks passed
@joaopgrassi joaopgrassi deleted the dynatrace-sampler branch April 3, 2024 07:54
jmcshane pushed a commit to superorbital/istio that referenced this pull request Apr 3, 2024
* Add Dynatrace sampler to OpenTelemetry Tracing Provider

* Add release notes

* Re-use http headers from exporter

* Improve comments

* Refactor http header creation

* precommit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OpenTelemetryTracingProvider: Allow configuring samplers
4 participants