{"slug": "opencode-observability-monitoring-with-opentelemetry", "title": "OpenCode Observability & Monitoring with OpenTelemetry", "summary": "SigNoz has released a guide for instrumenting OpenCode AI coding sessions with OpenTelemetry to collect traces, logs, and metrics for real-time observability. The integration allows developers to monitor tool calls, track token usage, and debug performance issues by sending telemetry data to SigNoz for correlation in a single dashboard.", "body_md": "What is OpenCode Observability?\n\nOpenCode observability and monitoring gives you real-time visibility into your AI coding sessions by collecting traces, logs, and metrics using [OpenTelemetry](https://opentelemetry.io/). 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.\n\nWith 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.\n\nPrerequisites\n\n- SigNoz setup (choose one):\n[SigNoz Cloud account](https://signoz.io/teams/)with an active ingestion key- Self-hosted SigNoz instance\n\n- Internet access to send telemetry data to SigNoz Cloud\n[OpenCode](https://opencode.ai/)installed and running on your system\n\nMonitor OpenCode with OpenTelemetry\n\nThe 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](https://github.com/DEVtheOPS/opencode-plugin-otel/blob/main/README.md)\n\nStep 1: Install the OpenTelemetry Plugin\n\nAdd the plugin to your OpenCode config at `~/.config/opencode/opencode.json`\n\n(create the file if it doesn't already exist):\n\n```\n{\n  \"$schema\": \"https://opencode.ai/config.json\",\n  \"plugin\": [\"@devtheops/opencode-plugin-otel\"]\n}\n```\n\nStep 2: Configure OpenTelemetry Environment Variables\n\nSet the required environment variables to enable telemetry and configure the OpenTelemetry endpoint:\n\n```\nexport OPENCODE_ENABLE_TELEMETRY=1\nexport OPENCODE_OTLP_ENDPOINT=\"https://ingest.<region>.signoz.cloud:443\"\nexport OPENCODE_OTLP_HEADERS=\"signoz-ingestion-key=<your-ingestion-key>\"\n```\n\n`<region>`\n\n: Your[SigNoz Cloud region](https://signoz.io/docs/ingestion/signoz-cloud/overview/#endpoint)`<your-ingestion-key>`\n\n: Your SigNoz[ingestion key](https://signoz.io/docs/ingestion/signoz-cloud/keys/)\n\nStep 3: Run OpenCode with Telemetry Enabled\n\nWith the environment variables set, you can now run OpenCode in one of two ways:\n\n**Option 1: Via VSCode**\n\nOpen your project in VSCode with the `code`\n\ncommand:\n\n```\ncode .\n```\n\nThe OpenCode VSCode extension will automatically pick up the environment variables and start with telemetry enabled.\n\n**Option 2: Via Terminal**\n\nRun OpenCode directly in your terminal using the `opencode`\n\ncommand:\n\n```\nopencode\n```\n\nView OpenCode Traces, Logs, and Metrics in SigNoz\n\nOnce configured, OpenCode automatically emits traces, logs, and metrics for every AI coding session.\n\nOpenCode traces are available in SigNoz under the Traces tab:\n\nWhen 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.\n\nOpenCode logs are available in SigNoz under the Logs tab.\n\nWhen you click on any of these logs in SigNoz, you'll see a detailed view of the log, including attributes:\n\nOpenCode metrics are available in SigNoz under the Metrics tab:\n\nWhen you click on any of these metrics in SigNoz, you'll see a detailed view of the metric, including attributes:\n\nTroubleshooting OpenCode Observability\n\n[Troubleshooting OpenCode Observability](#troubleshooting-opencode-observability)\n\nIf you don't see your telemetry data:\n\n**Verify network connectivity**: Ensure your application can reach SigNoz Cloud endpoints** Check ingestion key**: Verify your SigNoz ingestion key is correct** Wait for data**: OpenTelemetry batches data before sending, so wait 10-30 seconds after making API calls** Try a console exporter**: Enable a console exporter locally to confirm that your application is generating telemetry data before it’s sent to SigNoz\n\nOpenCode Observability Dashboard\n\nThe [OpenCode observability dashboard](https://signoz.io/docs/dashboards/dashboard-templates/opencode-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.\n\nSetup OpenTelemetry Collector (Optional)\n\n[Setup OpenTelemetry Collector (Optional)](#setup-opentelemetry-collector-optional)\n\nWhat is the OpenTelemetry Collector?\n\nThink 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.\n\nWhy use it?\n\n**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.\n\nSee [Switch from direct export to Collector](https://signoz.io/docs/opentelemetry-collection-agents/opentelemetry-collector/switch-to-collector/) for step-by-step instructions to convert your setup.\n\nFor more details, see [Why use the OpenTelemetry Collector?](https://signoz.io/docs/opentelemetry-collection-agents/opentelemetry-collector/why-to-use-collector/) and the [Collector configuration guide](https://signoz.io/docs/opentelemetry-collection-agents/opentelemetry-collector/configuration/).\n\nAdditional resources:\n\n- Set up\n[alerts](https://signoz.io/docs/product-features/alert-management)for high latency or error rates - Learn more about\n[querying traces](https://signoz.io/docs/product-features/trace-explorer) - Explore\n[log correlation](https://signoz.io/docs/product-features/logs-explorer)", "url": "https://wpnews.pro/news/opencode-observability-monitoring-with-opentelemetry", "canonical_source": "https://signoz.io/docs/opencode-observability", "published_at": "2026-05-26 00:00:00+00:00", "updated_at": "2026-05-27 13:27:08.179608+00:00", "lang": "en", "topics": ["ai-tools", "ai-infrastructure", "mlops", "artificial-intelligence", "ai-products"], "entities": ["OpenCode", "OpenTelemetry", "SigNoz", "SigNoz Cloud"], "alternates": {"html": "https://wpnews.pro/news/opencode-observability-monitoring-with-opentelemetry", "markdown": "https://wpnews.pro/news/opencode-observability-monitoring-with-opentelemetry.md", "text": "https://wpnews.pro/news/opencode-observability-monitoring-with-opentelemetry.txt", "jsonld": "https://wpnews.pro/news/opencode-observability-monitoring-with-opentelemetry.jsonld"}}