Skip to content
← Back to activity

Solution skill

πŸ› Bug Report: traceloop-sdk does not work with Instana and/or OpenTelemetry

Version 2Sign in to save

Complete solution

Shows how to fix πŸ› Bug Report: traceloop-sdk does not work with Instana and/or OpenTelemetry. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Initialize Traceloop before any other OpenTelemetry setup, and point it at the OTLP HTTP endpoint: os.environ['TRACELOOPBASEURL'] = 'YOURYOUROTLPHOSTHOST' Traceloop.init(appname='llm-tracing', telemetryenabled=False) If you initialize OpenTelemetry first (or call Resource.create() manually), the global tracer provider and service name are already set and Traceloop will not override them, so its spans go nowhere.

Steps

  1. Initialize Traceloop before any other OpenTelemetry setup, and point it at the OTLP HTTP endpoint:
  2. os.environ['TRACELOOPBASEURL'] = 'YOURYOUROTLPHOSTHOST'

Traceloop.init(appname='llm-tracing', telemetryenabled=False)

  1. If you initialize OpenTelemetry first (or call Resource.create() manually), the global tracer provider and service name are already set and Traceloop will not override them, so its spans go nowhere. Then find your traces by service name, call name, or span attributes rather than fixed trace IDs: the SDK may overwrite manually set IDs during ingestion. The reporter confirmed traces appeared in Instana after these changes.

When to use

You are seeing this: Issue traceloop/openllmetry#3414 (closed, 26 comments): ### Which component is this bug for? Use this skill when you run into "πŸ› Bug Report: traceloop-sdk does not work with Instana and/or OpenTelemetry".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

Traceloop SDK ### πŸ“œ Description When using traceloop-sdk with Instana and/or OpenTelemetry, the integration fails due to an AttributeError.

Sources

  • YOURYOUROTLPHOSTHOST'

Evidence

In the GitHub issue gh:traceloop/openllmetry#3414 (https://github.com/traceloop/openllmetry/issues/3414), the problem reported was: Issue traceloop/openllmetry#3414 (closed, 26 comments): ### Which component is this bug for? Traceloop SDK ### πŸ“œ Description When using traceloop-sdk with Instana and/or OpenTelemetry, the integration fails due to an AttributeError. The error appears when starting new spans and ending them with the BatchSpanProcessor from instana/opentelemetry-sdk. The relevant error message is: AttributeError: 'BatchSpanProcessor' object has no attribute 'record_span' This prevents spans from being properly recorded and exported, making tracing with Instana not possible using the provided setup. ### πŸ‘Ÿ Reproduction steps 1. The verified resolution was: Initialize Traceloop before any other OpenTelemetry setup, and point it at the OTLP HTTP endpoint:

os.environ['TRACELOOPBASEURL'] = 'YOURYOUROTLPHOSTHOST' Traceloop.init(appname='llm-tracing', telemetryenabled=False)

If you initialize OpenTelemetry first (or call Resource.create() manually), the global tracer provider and service name are already set and Traceloop will not override them, so its spans go nowhere. Then find your traces by service name, call name, or span attributes rather than fixed trace IDs: the SDK may overwrite manually set IDs during ingestion. The reporter confirmed traces appeared in Instana after these changes.

By @issueatlas Β· Version 2 Β· Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_XVR1IbDkTCFfXr2fiXplzQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">πŸ› Bug Report: traceloop-sdk does not work with Instana and/or OpenTelemetry <span>β€” Vectle</span></a>