Use this skill to instrument an AI application—an LLM app, agent, RAG
pipeline, or chatbot—with raw OpenTelemetry so its traces land in Confident
AI. No confident-trace package is needed. The job is exactly two things:
export to the correct Confident AI OTLP endpoint and set the confident.*
attributes Confident AI reads from each span.
Scope: AI Applications Only
Instrument only agent loops and planning, LLM calls, retrieval/vector search,
and tool calls. Do not apply confident.* attributes to web servers, CRUD
backends, database layers, infrastructure, or non-AI spans. If the target has
no LLM, agent, retrieval, or tool-calling component, this skill does not apply.
When to Use vs the Other Skills
- This skill (
confident-otel)—vendor-neutral OTLP export and rawconfident.*attributes without the confident-trace package. confident-tracingskill—automatic integrations and custom SDK spans in Python or TypeScript.deepevalskill—evaluation suites, datasets, metrics, and test runs.
Prerequisites
- A project-scoped
CONFIDENT_API_KEY. - An OpenTelemetry SDK for the application's language.
- For Python,
opentelemetry-sdkandopentelemetry-exporter-otlp-proto-http. - Direct Confident AI Cloud export uses OTLP/HTTP, never gRPC.
How It Works
Point an OTLP/HTTP traces exporter at Confident AI with the
x-confident-api-key header. Confident AI reads confident.* attributes from
the spans. Parent/child nesting, trace IDs, sampling, status, links, and context
propagation remain native OpenTelemetry concerns.
Workflow
- Confirm the target is an AI application, then inspect for an existing
TracerProvider, exporter, Collector, or APM pipeline. - Choose the direct Cloud endpoint from the API key's region prefix. Read
references/endpoint-and-exporter.md. - Wire or repoint an OTLP/HTTP exporter with the
x-confident-api-keyheader. For Python, start fromtemplates/confident_otel_setup.py. - If the process emits unrelated OpenTelemetry spans, isolate Confident AI export so only AI spans reach it.
- Set
confident.span.*fields on spans andconfident.trace.*fields for the whole trace. Readreferences/span-attributes.mdandreferences/trace-attributes.md. - JSON-encode objects and metadata; use native homogeneous primitive arrays for string lists.
- If the app already emits
gen_ai.*semantic-convention attributes, readreferences/gen-ai-fallbacks.mdbefore adding redundant fields. - Flush after active work completes and verify the trace hierarchy in Confident AI.
Core Principles
- Instrument and export AI components only.
- Prefer repointing an existing exporter over adding a duplicate pipeline.
- The
confident.*keys are language-neutral. - Direct Confident AI Cloud export always uses OTLP/HTTP. A Collector may use another protocol on its application-facing side.
- Set
confident.span.typeexplicitly when known; usegen_ai.*inference only as a fallback. - Never hardcode API keys or record secrets and unapproved sensitive content.
- Preserve native OpenTelemetry trace IDs, parentage, sampling, status, resources, links, and propagation.
References
| Topic | File |
|---|---|
| Endpoints, region selection, authentication, exporter wiring, and filtering | references/endpoint-and-exporter.md |
Trace-level confident.trace.* attributes |
references/trace-attributes.md |
Span-level confident.span.* attributes and data-type rules |
references/span-attributes.md |
Standard OpenTelemetry gen_ai.* fallback behavior |
references/gen-ai-fallbacks.md |
Templates
| Purpose | Template |
|---|---|
| Minimal Python OTLP exporter setup and example trace | templates/confident_otel_setup.py |