OpenTelemetryTracingProvider: Allow configuring samplers#3134
OpenTelemetryTracingProvider: Allow configuring samplers#3134istio-testing merged 6 commits intoistio:masterfrom
Conversation
Add API configurations for the Dynatrace sampler.
| // | ||
| // When not provided, the Dynatrace Sampler will re-use the configuration from the OpenTelemetryTracingProvider HTTP Exporter | ||
| // (`service`, `port` and `http`), including the access token. | ||
| DynatraceApi http_service = 4; |
There was a problem hiding this comment.
The idea behind this optional field is: Dynatrace customers use the OpenTelemetry collector as a central place for processing the spans before sending it to Dynatrace (removing PII from attributes, adding attributes, batching, etc).
In this case, Istio/Envoy can be configured to export to the Collector via gRPC, but still use the Dynatrace Sampler to sample the spans properly before exporting to the collector.
When the Dynatrace customer doesn't use the collector and prefers to send the spans directly to the Dynatrace API, then the Sampler simply re-use the config from the HTTP exporter (service/host, http headers and etc). This is so the configuration stays minimal as most things would be just repeated in this case.
There was a problem hiding this comment.
I think it confuses if this is set under opentelemetry provider
There was a problem hiding this comment.
it's fine to place under DynatraceSampler, a vendor extension.
| // REQUIRED. The Dynatrace tenant. | ||
| // | ||
| // The value can be obtained from the Istio deployment page in Dynatrace. | ||
| string tenant = 1; |
There was a problem hiding this comment.
This is a Dynatrace specific field. Each Dynatrace customer receives a "Tenant Id" and that is what this field is for. It identifies the customer's tenant in our SaaS product.
|
@howardjohn could you please take a look? This is the sampling PR we talked a while ago. #3002 (comment). It would be really great if we can get this merged so it can be part of the 1.22 release. I already have the Istio code ready, just waiting for this to open the feature PR. Thank you! |
API part of istio/istio#50001
The OpenTelemetry project defines a Sampler API and this API is available now in Envoy. With the next Envoy release, it will also come with a Dynatrace Sampler. This API in Envoy allows anyone (vendors for ex) to add their own sampler.
This PR then adds this new configuration on Istio, containing for now the Dynatrace sampler config.
Today, there's multiple ways to configure sampling, which works/have the following precedence:
This PR adds another option, changing the order above to:
Which means:
If
OpenTelemetryTracingProviderhas a custom sampler configured (what this PR adds):telemetry.RandomSamplingPercentageto100as 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:
Note: I didn't add the
AlwaysOnsince that is basically achieved the same way by setting thetelemetry.RandomSamplingPercentageto100.CC @howardjohn @zirain