OpenTelemetry GenAI Instrumentation Generator
Generate OpenTelemetry setup code for LLM calls in Python or Node.js, with spans named and attributed using the GenAI semantic conventions, exporter settings for your backend, and an optional collector config.
- Free, runs in your browser
- Python and Node.js
- 5 LLM providers
Choose your stack
Application
Choose your language, provider and destination, then press Generate code.
- Install command
- Environment variables
- app.py
Everything you need for a first GenAI trace
Install command
Environment variables
Instrumented LLM call
Error handling
Collector config
No prompt capture by default
Why OpenTelemetry for LLM calls?
OpenTelemetry is the open standard for traces, metrics and logs. Its GenAI semantic conventions give model calls, agent steps and tool executions standard names, so Langfuse, LangSmith, Datadog, Perimattic AI Suite and other backends can all read the same spans. Instrument once and you can change or add backends with configuration rather than code.
For the bigger picture, read LLM observability and AI agent observability.
Frequently asked questions
What are the OpenTelemetry GenAI semantic conventions?
They are the standard names OpenTelemetry defines for describing generative AI operations, such as gen_ai.operation.name, gen_ai.provider.name, gen_ai.request.model, gen_ai.usage.input_tokens and gen_ai.usage.output_tokens. Using them means any backend that understands the conventions can read your traces. They are still marked as in development, so names can change between releases.
Why instrument LLM calls manually instead of using an auto-instrumentation library?
Manual spans are explicit and portable: you control exactly which attributes are recorded and nothing else is captured by accident. Auto-instrumentation libraries such as OpenLLMetry or OpenInference save time and cover more frameworks, but check which attribute conventions they emit. The generated code works alongside either approach.
Should I send traces through an OpenTelemetry Collector?
For production, usually yes. A collector lets you batch and retry exports, remove personal data before it leaves your network, and send the same spans to more than one backend, for example an AI observability tool and your existing APM. For a quick test, exporting straight from the app is fine.
Does the generated code record prompts and responses?
No. It records the operation, provider, model, token counts and finish reason, which is enough for latency, cost and reliability dashboards. Recording message content is optional in the conventions and often contains personal data, so add it deliberately and redact it in the collector.
Where do I get a Perimattic AI Suite endpoint and key?
They are issued during Perimattic AI Suite early-access onboarding. The generated code uses placeholders until then, and works unchanged with any other backend that accepts OTLP over HTTP.
Is my input sent anywhere?
No. The code is generated in your browser. Nothing you choose here is submitted to Perimattic.
Related Tools
LLM Observability Cost Calculator
Compare what Langfuse, LangSmith and Datadog would cost for your traces.
Try it free AssessmentAI Observability Maturity Assessment
See which tracing, evaluation and governance practices you have.
Try it free CalculatorLLM Cost Calculator
Estimate token cost per request, per agent task and per user.
Try it freeWant help instrumenting a production AI system?
Perimattic's DevOps and platform engineers set up OpenTelemetry pipelines, collectors and dashboards for AI workloads.
Or email sales@perimattic.com