open-telemetry / open-telemetry/opentelemetry-python

Setting OTEL_TRACES_SAMPLER_ARG=always_off results in no spans being exported

Open
#3,851 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
2.6k
Forks
1k
Avg merge
4d 15h
Merged PRs (30d)
19

Description

Describe your environment Describe any aspect of your environment relevant to the problem, including your Python version, platform, version numbers of installed dependencies, information about your cloud hosting provider, etc. If you're reporting a problem with a specific version of a library in this repo, please check whether the problem has been fixed on main.
According to https://opentelemetry-python.readthedocs.io/en/latest/sdk/trace.sampling.html setting OTEL_TRACES_SAMPLER_ARG=always_off should turn off sampling allowing all the spans to go through to the collector. However what actually ends up happening is that no spans are sent. This needs a clarification in the docs or some update in the behavior of that setting. Per https://github.com/open-telemetry/opentelemetry-python/issues/3474#issuecomment-1771355829, it seems like the expected behavior this effectively stops spans from being exported.

Steps to reproduce
Set OTEL_TRACES_SAMPLER_ARG=always_off

What is the expected behavior?
What did you expect to see?
Expect all samples to be sent to collector

What is the actual behavior?
What did you see instead?
No spans are sent to the collector

Additional context
Version: 0.44b0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the trace sampling documentation linked in the issue and review the behavior described in issue #3474's linked comment. Reproduce with OTEL_TRACES_SAMPLER_ARG=always_off using version 0.44b0, then determine whether the documented expectation or the implementation should change. Done means the behavior and documentation agree about whether spans reach the collector.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
observability
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.