Skip to content

🐛 Bug Report: Telemetry enabled regardless of parameter #3175

@roger-collins-self

Description

@roger-collins-self

Which component is this bug for?

Traceloop SDK

📜 Description

Telemetry is being sent to posthog regardless of explicitly being disabled.

👟 Reproduction steps

Enable debug logging, then explicitly disable telemetry.

export LOG_LEVEL=DEBUG
Traceloop.init(telemetry_enabled=False)

👍 Expected behavior

No traces should be sent to Posthog

👎 Actual Behavior with Screenshots

2025-07-25 10:36:55 [debug    ] https://us.i.posthog.com:443 "POST /batch/ HTTP/1.1" 200 15 [urllib3.connectionpool]

🤖 Python Version

3.11.12

📃 Provide any additional context for the Bug.

It looks like the Telemetry class is instantiated in multiple places aside from Traceloop.init and is enabled by default unless the environment variable is set:

    def __new__(cls) -> "Telemetry":
        if not hasattr(cls, "instance"):
            obj = cls.instance = super(Telemetry, cls).__new__(cls)
            obj._telemetry_enabled = (
                os.getenv("TRACELOOP_TELEMETRY") or "true"
            ).lower() == "true" and "pytest" not in sys.modules

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

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions