2

According to the document

  • "traceidratio": TraceIdRatioBased
  • "parentbased_traceidratio": ParentBased(root=TraceIdRatioBased)

What I understood:

  • traceidratio will do sampling irrespective of whether sampling is done at source/parent. (Meaning: a sampled trace be sampled again??)

  • parentbased_traceidratio would respect the sampling flag on the basis of the parent.

But doesn't seem so I think. What is the difference between the two?

Background: Setting sampling on istio to 100 and setting the environment variable to OTEL_TRACES_SAMPLER to traceidratio or parentbased_traceidratioand OTEL_TRACES_SAMPLER_ARG to 0.001 did not show any reduction/sampling from the application itself. (All traces we available on jaeger indicating there was no reduction or sampling). A simple python based app that uses open-telemetry-python. setting OTEL to debug logs did not show anything specific either.

By documentation setting the env variables should change the sampling of traces in the application.

Vipin Menon
  • 2,892
  • 4
  • 20
  • 35

1 Answers1

0

traceidratio will ignore the decision made on the parent span and will make a new one based on the ratio. A span can't be sampled twice. When creating a span, we make a sampling decision, which happens once; either we make a new decision or respect the parent's decision.

So setting OTEL_TRACES_SAMPLER to traceidratio with 0.001 should reduce the number of spans.

mottibec
  • 146
  • 1
  • 6