Skip to main content

OpenLLMetry

OpenLLMetry instruments your LLM application with OpenTelemetry and emits standard OTLP data. To send it to Logz.io, point the Traceloop SDK at a collector that ships to Logz.io: the Logz.io APM collector on Kubernetes, or an OpenTelemetry collector on any host.

Before you begin, you'll need:

  • An LLM application (OpenAI, Anthropic, LangChain, LlamaIndex, and more)
  • An active Logz.io Tracing account

Instrument your application​

Follow the Traceloop installation guide for your language:

LanguageGuide
PythonGetting started with Python
Node.jsGetting started with Node.js
Next.jsGetting started with Next.js
GoGetting started with Go
RubyGetting started with Ruby
note

AI Observability currently supports Python and Node.js applications built with LangChain or LangGraph. Support for more frameworks, direct LLM SDK calls and other languages is coming soon.

Use the latest SDK release. For Python, traceloop-sdk 0.57.0 or later is required.

Optional settings​

SettingWhen you need itGuide (Python and Node.js)
WorkflowYour app calls an LLM SDK directly (for example OpenAI, Anthropic or Bedrock) instead of LangChain or LangGraph. Wrap each agent request in a workflow so it appears as a run.Workflow annotations
SessionYou want to see the runs of one conversation together. Set the association property thread_id to your conversation ID.Association properties

Send your data to Logz.io​

Deploy the Logz.io APM collector​

If you already run the logzio-monitoring chart with logzio-apm-collector.enabled=true, skip to the next step.

helm repo add logzio-helm https://logzio.github.io/logzio-helm && helm repo update

helm install -n monitoring --create-namespace \
--set logzio-apm-collector.enabled=true \
--set logzio-apm-collector.SamplingProbability=100 \
--set global.logzioTracesToken="<<TRACING-SHIPPING-TOKEN>>" \
--set global.logzioRegion="<<LOGZIO_ACCOUNT_REGION_CODE>>" \
--set global.env_id="<<CLUSTER-NAME>>" \
logzio-monitoring logzio-helm/logzio-monitoring
  • Replace <<TRACING-SHIPPING-TOKEN>> with the token of the account you want to ship to.
  • Replace <<LOGZIO_ACCOUNT_REGION_CODE>> with the applicable region code.
  • Replace <<CLUSTER-NAME>> with a name for your cluster. It appears as the Environment of your runs.

SamplingProbability=100 keeps every trace, so every agent run appears in AI Observability.

For all chart options, see Kubernetes.

Point your application at the collector​

Add the following environment variables to your application's container:

env:
- name: TRACELOOP_BASE_URL
value: http://logzio-apm-collector.monitoring.svc.cluster.local:4318
- name: TRACELOOP_METRICS_ENABLED
value: "false"
# Optional: set to "false" to stop recording prompts and responses
- name: TRACELOOP_TRACE_CONTENT
value: "true"
  • The APM collector receives traces only, so SDK metrics are turned off. AI Observability is built from traces.
  • By default, OpenLLMetry records prompts, responses, and tool inputs and outputs on the spans. These may contain personal data. Set TRACELOOP_TRACE_CONTENT to "false" to turn this off.

The service name shown in Logz.io comes from the SDK's app_name (appName in Node.js) initialization option.

View your data in Logz.io​

Run your LLM application to generate some data, then give it time to process:

  • AI Observability shows your agent runs. Search runs, open a run to see each step, and use the Monitoring tab for an overview of volume, errors, latency and tokens. AI Observability is in beta; contact Logz.io Support to enable it for your account.
  • Traces appear in your Tracing dashboard. Each LLM call is a span, with the model, prompt, completion and token usage as span attributes.
  • Metrics (OpenTelemetry collector setup) appear in your Metrics dashboard, under metric names starting with gen_ai_, llm_ or db_.
  • Logs (OpenTelemetry collector setup) appear in Explore.