traceloop / traceloop/openllmetry

๐Ÿ› Bug Report: TRACELOOP_TRACING_ENABLED does not match Traceloop.init(enabled) parameter behavior

Open Beginner friendly
#4,191 0 comments 0 reactions 0 assignees View on GitHub

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
  1. set TRACELOOP_TRACING_ENABLED=false
  2. run Traceloop.init()
  3. run:
from traceloop.sdk.decorators import workflow

@workflow(name="hello-world")
def hello_world():
    return "hello world!"

hello_world()
๐Ÿ‘ Expected behavior
  1. printed "Traceloop instrumentation is disabled via init flag"

  2. nothing

๐Ÿ‘Ž Actual Behavior with Screenshots
  1. printed "Tracing is disabled"

  2. 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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.