traceloop / traceloop/openllmetry
๐ Bug Report: TRACELOOP_TRACING_ENABLED does not match Traceloop.init(enabled) parameter behavior
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7.4k
- Forks
- 1.1k
- Avg merge
- 8d 14h
- Merged PRs (30d)
- 2
Description
Which component is this bug for?
Traceloop SDK
๐ Description
Traceloop.init(enabled=False) works as a no-op setting. Any subsequent call on instrumented methods are silently skipped.
TRACELOOP_TRACING_ENABLED=false does not work in the same way. E.g calling methods that are decorated with @workflow() yields error logs.
๐ Reproduction steps
- set TRACELOOP_TRACING_ENABLED=false
- run
Traceloop.init() - run:
from traceloop.sdk.decorators import workflow
@workflow(name="hello-world")
def hello_world():
return "hello world!"
hello_world()
๐ Expected behavior
-
printed "Traceloop instrumentation is disabled via init flag"
-
nothing
๐ Actual Behavior with Screenshots
-
printed "Tracing is disabled"
-
printed "Warning: Traceloop not initialized, make sure you call Traceloop.init()"
๐ค Python Version
3.12
๐ Provide any additional context for the Bug.
Probably related to the two different ways of handling disabled in these lines.
๐ Have you spent some time to check if this bug has been raised before?
- I checked and didn't find similar issue
Are you willing to submit PR?
Yes I am willing to submit a PR!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up โ it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in traceloop/sdk/init.py at the linked lines 111-126 and compare the environment-variable and init-parameter disabled paths. Run the provided Python reproduction with TRACELOOP_TRACING_ENABLED=false; done means decorated methods are silently skipped without the not-initialized warning, matching Traceloop.init(enabled=False).
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- observability
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 74/100