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 Logo
SigNoz
All systems operational
HIPAASOC-2
SigNoz Cloud - This page applies to SigNoz Cloud editions.
Self-Host - This page applies to self-hosted SigNoz editions.

Dify Observability & Monitoring with OpenTelemetry

Overview

This guide walks you through setting up observability and monitoring for Dify using OpenTelemetry and exporting traces and metrics to SigNoz. With this integration, you can observe and track various metrics for your Dify agent workflows.

Monitoring 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.

Prerequisites

  • A SigNoz Cloud account with an active ingestion key or Self Hosted SigNoz instance
  • A Dify self-hosted instance. Follow the Dify quickstart guide to get set up

Monitoring Dify

For more information on instrumenting your Dify workflows with OpenTelemetry, refer to the Dify OpenTelemetry configuration docs.

Step 1: Configure OpenTelemetry in your Dify .env file

Open the .env file in your Dify /docker directory and add the following environment variables:

# ------------------------------
# OTLP Collector Configuration
# ------------------------------
ENABLE_OTEL=true
OTLP_BASE_ENDPOINT=https://ingest.<region>.signoz.cloud:443
OTEL_EXPORTER_OTLP_HEADERS=signoz-ingestion-key=<your-ingestion-key>
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
OTEL_EXPORTER_TYPE=otlp
OTEL_SAMPLING_RATE=1.0
OTEL_BATCH_EXPORT_SCHEDULE_DELAY=5000
OTEL_MAX_QUEUE_SIZE=2048
OTEL_MAX_EXPORT_BATCH_SIZE=512
OTEL_METRIC_EXPORT_INTERVAL=60000
OTEL_BATCH_EXPORT_TIMEOUT=10000
OTEL_METRIC_EXPORT_TIMEOUT=30000
  • <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 2: Apply the required code change

In docker/docker-compose.yaml, find the x-shared-api-worker-env block and add the following line alongside the other OTLP_* variables:

OTEL_EXPORTER_OTLP_HEADERS: ${OTEL_EXPORTER_OTLP_HEADERS:-}

This forwards the OTEL_EXPORTER_OTLP_HEADERS value from your .env file into the API and worker containers so the OpenTelemetry SDK can read it.

Step 3: Restart Dify with the applied changes

From your /docker directory, run:

docker compose up -d

This restarts all Dify services with the updated environment variables, enabling OpenTelemetry export to SigNoz.

Cloud support is coming soon. Stay tuned for updates.

View Traces and Metrics in SigNoz

Your Dify usage should now automatically emit traces and metrics.

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

Dify Trace View
Dify 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.

Dify Detailed Trace View
Dify Detailed Trace View

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

Dify Metrics View
Dify Metrics View

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

Dify Detailed Metrics View
Dify 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 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.

Dify Dashboard
Dify 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:

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

Last updated: May 20, 2026

Edit on GitHub

Was this page helpful?

Your response helps us improve this page.

Prev
DeepSeek
Next
Google ADK
On this page
Overview
Prerequisites
Monitoring Dify
Step 1: Configure OpenTelemetry in your Dify `.env` file
Step 2: Apply the required code change
Step 3: Restart Dify with the applied changes
View Traces and Metrics in SigNoz
Troubleshooting
Next Steps
Setup OpenTelemetry Collector (Optional)
What is the OpenTelemetry Collector?
Why use it?

Is this page helpful?

Your response helps us improve this page.