SigNoz
Docs
PricingCustomers
Get Started - Free
Docs
IntroductionContributingMigrate from DatadogSigNoz API
OpenTelemetry
What is OpenTelemetryOpenTelemetry Collector GuideOpenTelemetry Demo
Community
Support
Slack
X
Launch Week
Changelog
Dashboard Templates
DevOps Wordle
Newsletter
KubeCon, Atlanta 2025
More
SigNoz vs DatadogSigNoz vs New RelicSigNoz vs GrafanaSigNoz vs Dynatrace
Careers
AboutTermsPrivacySecurity & Compliance
SigNoz - Open Source Datadog Alternative
SigNoz
All systems operational
HIPAASOC-2
  1. Docs
  2. LLM Observability
  3. OpenCode Observability & Monitoring with OpenTelemetry

OpenCode Observability & Monitoring with OpenTelemetry

SigNoz Cloud - This page applies to SigNoz Cloud editions.
Self-Host - This page applies to self-hosted SigNoz editions.

What is OpenCode Observability?

OpenCode observability and monitoring gives you real-time visibility into your AI coding sessions by collecting traces, logs, and metrics using OpenTelemetry. This guide shows you how to instrument OpenCode with the OpenTelemetry plugin and send telemetry data to SigNoz, so you can monitor tool calls, track token usage, and debug performance issues directly from your development workflow.

With full OpenCode observability in SigNoz, you can correlate traces, logs, and metrics in a single dashboard, set up alerts for error rates or high latency, and analyze usage patterns over time to continuously improve reliability and efficiency.

Prerequisites

  • SigNoz setup (choose one):
    • SigNoz Cloud account with an active ingestion key
    • Self-hosted SigNoz instance
  • Internet access to send telemetry data to SigNoz Cloud
  • OpenCode installed and running on your system

Monitor OpenCode with OpenTelemetry

The steps below walk you through installing and configuring OpenTelemetry for OpenCode to export traces, logs, and metrics to SigNoz. For full plugin details, see the official plugin documentation

Step 1: Install the OpenTelemetry Plugin

Add the plugin to your OpenCode config at ~/.config/opencode/opencode.json (create the file if it doesn't already exist):

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["@devtheops/opencode-plugin-otel"]
}

Step 2: Configure OpenTelemetry Environment Variables

Set the required environment variables to enable telemetry and configure the OpenTelemetry endpoint:

export OPENCODE_ENABLE_TELEMETRY=1
export OPENCODE_OTLP_ENDPOINT="https://ingest.<region>.signoz.cloud:443"
export OPENCODE_OTLP_HEADERS="signoz-ingestion-key=<your-ingestion-key>"
  • <region>: Your SigNoz Cloud region
  • <your-ingestion-key>: Your SigNoz ingestion key

Most steps are identical. To adapt this guide, update the endpoint and remove the ingestion key header as shown in Cloud β†’ Self-Hosted.

Step 3: Run OpenCode with Telemetry Enabled

With the environment variables set, you can now run OpenCode in one of two ways:

Option 1: Via VSCode

Open your project in VSCode with the code command:

code .

The OpenCode VSCode extension will automatically pick up the environment variables and start with telemetry enabled.

Option 2: Via Terminal

Run OpenCode directly in your terminal using the opencode command:

opencode

View OpenCode Traces, Logs, and Metrics in SigNoz

Once configured, OpenCode automatically emits traces, logs, and metrics for every AI coding session.

OpenCode traces are available in SigNoz under the Traces tab:

OpenCode traces in SigNoz showing AI coding session activity
OpenCode traces in SigNoz: monitor AI coding session spans

When you click on a trace in SigNoz, you'll see a detailed view of the trace, including all associated spans, along with their events and attributes.

OpenCode detailed trace view in SigNoz with spans, events, and attributes
OpenCode detailed trace in SigNoz: spans, events, and attributes per coding session

OpenCode logs are available in SigNoz under the Logs tab.

OpenCode logs in SigNoz showing telemetry output from AI coding sessions
OpenCode logs in SigNoz: real-time log output from AI coding sessions

When you click on any of these logs in SigNoz, you'll see a detailed view of the log, including attributes:

OpenCode detailed log view in SigNoz with log attributes and metadata
OpenCode detailed log entry in SigNoz: log attributes and metadata

OpenCode metrics are available in SigNoz under the Metrics tab:

OpenCode metrics in SigNoz showing token usage and performance data
OpenCode metrics in SigNoz: track token usage, latency, and performance

When you click on any of these metrics in SigNoz, you'll see a detailed view of the metric, including attributes:

OpenCode detailed metric view in SigNoz with metric attributes and time series
OpenCode detailed metric in SigNoz: metric attributes and time series data

Troubleshooting OpenCode Observability

If you don't see your telemetry data:

  1. Verify network connectivity: Ensure your application can reach SigNoz Cloud endpoints
  2. Check ingestion key: Verify your SigNoz ingestion key is correct
  3. Wait for data: OpenTelemetry batches data before sending, so wait 10-30 seconds after making API calls
  4. Try a console exporter: Enable a console exporter locally to confirm that your application is generating telemetry data before it’s sent to SigNoz

OpenCode Observability Dashboard

The OpenCode observability dashboard gives you pre-built charts tailored for AI coding agents, so you can monitor token usage, tool calls, and session performance out of the box.

OpenCode observability dashboard in SigNoz with pre-built charts for AI coding sessions
OpenCode dashboard template in SigNoz: pre-built charts for monitoring AI coding sessions

Setup OpenTelemetry Collector (Optional)

What is the OpenTelemetry Collector?

Think of the OTel Collector as a middleman between your app and SigNoz. Instead of your application sending data directly to SigNoz, it sends everything to the Collector first, which then forwards it along.

Why use it?

  • Cleaning up data: Filter out noisy traces you don't care about, or remove sensitive info before it leaves your servers.
  • Keeping your app lightweight: Let the Collector handle batching, retries, and compression instead of your application code.
  • Adding context automatically: The Collector can tag your data with useful info like which Kubernetes pod or cloud region it came from.
  • Future flexibility: Want to send data to multiple backends later? The Collector makes that easy without changing your app.

See Switch from direct export to Collector for step-by-step instructions to convert your setup.

For more details, see Why use the OpenTelemetry Collector? and the Collector configuration guide.

Additional resources:

  • Set up alerts for high latency or error rates
  • Learn more about querying traces
  • Explore log correlation

Last updated: May 26, 2026

Edit on GitHub

Was this page helpful?

Your response helps us improve this page.

Prev
OpenClaw
Next
OpenLIT
On this page
What is OpenCode Observability?
Prerequisites
Monitor OpenCode with OpenTelemetry
Step 1: Install the OpenTelemetry Plugin
Step 2: Configure OpenTelemetry Environment Variables
Step 3: Run OpenCode with Telemetry Enabled
View OpenCode Traces, Logs, and Metrics in SigNoz
Troubleshooting OpenCode Observability
OpenCode Observability Dashboard
Setup OpenTelemetry Collector (Optional)
What is the OpenTelemetry Collector?
Why use it?

Is this page helpful?

Your response helps us improve this page.