Tail sampling - boolean_attribute not work for attributes from OTEL_RESOURCE_ATTRIBUTES #37200
Unanswered
gamerslouis
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
Context
opentelemetry-operator: 0.114.1
opentelemetry-collector: 0.114.1
autoinstrumentation-python: 0.48b0
Description
I am integrating OpenTelemetry into our environment and encountered an issue while using the tail sampling processor with a "force accept" policy. Following the example provided in the tail sampling documentation, I configured the policy as follows:
To test this configuration, I deployed a Python FastAPI server in a Kubernetes pod with OpenTelemetry auto-instrumentation enabled via the operator. I also set the OTEL_RESOURCE_ATTRIBUTES environment variable to:
app.force_sample=true
However, this setup did not work as expected. The OpenTelemetry instrumentation treats the value "true" as a string. Referring to the tail sampling library documentation, this results in the boolean value being interpreted as false.
To address this issue and allow the policy to work with both environment variable inputs and SDK settings, I implemented the following workaround by adding two policy rules for different value types:
Questions
Beta Was this translation helpful? Give feedback.
All reactions