Perimattic

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
Editor window with source code on screen
ISO 27001 Certified
AWS Partner
Microsoft Partner
ServiceNow Partner
Calculator

Choose your stack

The code updates as you change options.

Application

Where traces go

Pick one or more. More than one uses a collector to fan out.

Choose your language, provider and destination, then press Generate code.

  • Install command
  • Environment variables
  • app.py
What You Get

Everything you need for a first GenAI trace

Copy, paste, replace the placeholders and run.

Install command

The OpenTelemetry SDK, an OTLP/HTTP exporter and your LLM provider’s SDK, for Python or Node.js.

Environment variables

Exporter endpoint and headers for your backend, plus the provider credentials the code expects.

Instrumented LLM call

A client span named and attributed with the OpenTelemetry GenAI conventions: operation, provider, model, token usage and finish reason.

Error handling

Exceptions are recorded on the span and the status set to error, so failures show up in traces and alerts.

Collector config

Optional OpenTelemetry Collector config that fans the same spans out to several backends.

No prompt capture by default

Message content is left out, because it often contains personal data. Add it deliberately and redact it in the collector.
Background

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.

Terminal windows and CI/CD pipeline dashboards on a developer screen
FAQ

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.

Need Expert Help?

Want 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