{"slug": "dify-observability-monitoring-with-opentelemetry", "title": "Dify Observability & Monitoring with OpenTelemetry", "summary": "SigNoz has released a guide for setting up observability and monitoring on Dify agent workflows using OpenTelemetry, enabling users to export traces and metrics to SigNoz for unified dashboards and alerting. The integration requires a SigNoz account or self-hosted instance, a Dify self-hosted instance, and configuration of OpenTelemetry environment variables in Dify's `.env` file to send telemetry data to SigNoz. This allows developers to track AI and LLM workflow performance, analyze correlated traces and metrics, and improve system reliability and user experience.", "body_md": "Overview\n\nThis guide walks you through setting up observability and monitoring for Dify using [OpenTelemetry](https://opentelemetry.io/) and exporting traces and metrics to SigNoz. With this integration, you can observe and track various metrics for your Dify agent workflows.\n\nMonitoring Dify agents with telemetry ensures full observability across your AI and LLM workflows. By leveraging SigNoz, you can analyze correlated traces and metrics in unified dashboards, configure alerts, and gain actionable insights to continuously improve reliability, responsiveness, and user experience.\n\nPrerequisites\n\n- A\n[SigNoz Cloud account](https://signoz.io/teams/)with an active ingestion key or[Self Hosted SigNoz instance](https://signoz.io/docs/install/self-host/) - A Dify self-hosted instance. Follow the\n[Dify quickstart guide](https://docs.dify.ai/en/self-host/quick-start/docker-compose)to get set up\n\nMonitoring Dify\n\nFor more information on instrumenting your Dify workflows with OpenTelemetry, refer to the [Dify OpenTelemetry configuration](https://docs.dify.ai/en/self-host/configuration/environments#otlp-%2F-opentelemetry-configuration) docs.\n\nStep 1: Configure OpenTelemetry in your Dify `.env`\n\nfile\n\nOpen the `.env`\n\nfile in your Dify `/docker`\n\ndirectory and add the following environment variables:\n\n```\n# ------------------------------\n# OTLP Collector Configuration\n# ------------------------------\nENABLE_OTEL=true\nOTLP_BASE_ENDPOINT=https://ingest.<region>.signoz.cloud:443\nOTEL_EXPORTER_OTLP_HEADERS=signoz-ingestion-key=<your-ingestion-key>\nOTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf\nOTEL_EXPORTER_TYPE=otlp\nOTEL_SAMPLING_RATE=1.0\nOTEL_BATCH_EXPORT_SCHEDULE_DELAY=5000\nOTEL_MAX_QUEUE_SIZE=2048\nOTEL_MAX_EXPORT_BATCH_SIZE=512\nOTEL_METRIC_EXPORT_INTERVAL=60000\nOTEL_BATCH_EXPORT_TIMEOUT=10000\nOTEL_METRIC_EXPORT_TIMEOUT=30000\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\nMost steps are identical. To adapt this guide, update the endpoint and remove the ingestion key header as shown in [Cloud → Self-Hosted](https://signoz.io/docs/ingestion/cloud-vs-self-hosted/#cloud-to-self-hosted).\n\nStep 2: Apply the required code change\n\nIn `docker/docker-compose.yaml`\n\n, find the `x-shared-api-worker-env`\n\nblock and add the following line alongside the other `OTLP_*`\n\nvariables:\n\n```\nOTEL_EXPORTER_OTLP_HEADERS: ${OTEL_EXPORTER_OTLP_HEADERS:-}\n```\n\nThis forwards the `OTEL_EXPORTER_OTLP_HEADERS`\n\nvalue from your `.env`\n\nfile into the API and worker containers so the OpenTelemetry SDK can read it.\n\nStep 3: Restart Dify with the applied changes\n\nFrom your `/docker`\n\ndirectory, run:\n\n```\ndocker compose up -d\n```\n\nThis restarts all Dify services with the updated environment variables, enabling OpenTelemetry export to SigNoz.\n\nCloud support is coming soon. Stay tuned for updates.\n\nView Traces and Metrics in SigNoz\n\nYour Dify usage should now automatically emit traces and metrics.\n\nYou should be able to view traces in SigNoz Cloud 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\nYou should be able to see Dify related metrics in SigNoz Cloud 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\n\n[Troubleshooting](#troubleshooting)\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\nNext Steps\n\nYou can also check out our custom [Dify dashboard](https://signoz.io/docs/dashboards/dashboard-templates/dify-dashboard/) which provides specialized visualizations for monitoring your Dify usage. The dashboard includes pre-built charts specifically tailored for LLM usage, along with import instructions to get started quickly.\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/dify-observability-monitoring-with-opentelemetry", "canonical_source": "https://signoz.io/docs/dify-observability", "published_at": "2026-05-20 00:00:00+00:00", "updated_at": "2026-05-26 14:18:11.713945+00:00", "lang": "en", "topics": ["artificial-intelligence", "large-language-models", "ai-agents", "ai-tools", "ai-infrastructure"], "entities": ["Dify", "OpenTelemetry", "SigNoz"], "alternates": {"html": "https://wpnews.pro/news/dify-observability-monitoring-with-opentelemetry", "markdown": "https://wpnews.pro/news/dify-observability-monitoring-with-opentelemetry.md", "text": "https://wpnews.pro/news/dify-observability-monitoring-with-opentelemetry.txt", "jsonld": "https://wpnews.pro/news/dify-observability-monitoring-with-opentelemetry.jsonld"}}