SigNoz Cloud - This page is relevant for SigNoz Cloud editions.
Self-Host - This page is relevant for self-hosted SigNoz editions.

OpenCode Observability & Monitoring with OpenTelemetry

Overview

This guide walks you through enabling observability and monitoring in OpenCode using OpenTelemetry and exporting traces, logs, and metrics to SigNoz using OpenTelemetry. Once set up, you’ll be able to track coding session activity, log outputs, and system-level metrics in SigNoz, giving you visibility into performance trends, error rates, and usage patterns directly from your development workflow.

Instrumenting OpenCode with telemetry provides full observability into how coding assistance is used in practice. With SigNoz, you can correlate traces, logs, and metrics in a single dashboard, set up alerts, and analyze historical data to continuously improve reliability, efficiency, and user experience.

Prerequisites

  • SigNoz setup (choose one):
  • Internet access to send telemetry data to SigNoz Cloud
  • OpenCode installed and running on your system

Monitoring OpenCode

For detailed instructions on setting up OpenTelemetry instrumentation for OpenCode, check out 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>"

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 Traces, Logs, and Metrics in SigNoz

Your OpenCode usage should now automatically emit traces, logs, and metrics.

You should be able to view traces in SigNoz Cloud under the traces tab:

OpenCode Trace View
OpenCode Trace View

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
OpenCode Detailed Trace View

You should be able to view logs in SigNoz Cloud under the logs tab.

OpenCode Logs View
OpenCode Logs View

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
OpenCode Detailed Logs View

You should be able to see OpenCode related metrics in SigNoz Cloud under the metrics tab:

OpenCode Metrics View
OpenCode Metrics View

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

OpenCode Detailed Metrics View
OpenCode Detailed Metrics View

Troubleshooting

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

Next Steps

You can also check out our custom OpenCode dashboard here which provides specialized visualizations for monitoring your OpenCode usage. The dashboard includes pre-built charts specifically tailored for AI coding agents, along with import instructions to get started quickly.

OpenCode Dashboard
OpenCode Dashboard Template

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:

Last updated: April 15, 2026

Edit on GitHub

Was this page helpful?

Your response helps us improve this page.