This guide shows you how to instrument your Deno application with OpenTelemetry and send traces, metrics, and logs to SigNoz. Deno has built-in support for OpenTelemetry, making it easy to get started without complex dependencies.
Prerequisites
- Deno v2.0 or later
- An instance of SigNoz (either Cloud or Self-Hosted)
Send telemetry to SigNoz
Deno auto-instrumentation automatically captures:
- Incoming HTTP requests (
Deno.serve) - Outgoing requests (
fetch) - Runtime metrics (Heap usage, GC duration)
- Console logs (
console.log,console.error)
Run the application
Step 1. Set environment variables
export OTEL_DENO=true
export OTEL_EXPORTER_OTLP_ENDPOINT="https://ingest.<region>.signoz.cloud:443"
export OTEL_EXPORTER_OTLP_HEADERS="signoz-ingestion-key=<your-ingestion-key>"
export OTEL_SERVICE_NAME="<service-name>"
Replace the following:
<region>: Your SigNoz Cloud region.<your-ingestion-key>: Your SigNoz ingestion key.<service-name>: Name of your service (e.g.,deno-app).
Step 2. Run the application
deno run --allow-env --allow-net app.ts
The OTEL_DENO=true flag enables the built-in instrumentation for http, fetch, runtime metrics, and console logs.
By default, auto-instrumentation captures logs as well, to disable logs set the following environmental variable:
export OTEL_DENO_CONSOLE=ignore
Step 1. Update deployment manifest
Add these environment variables to your deployment manifest:
env:
- name: OTEL_DENO
value: "true"
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: "https://ingest.<region>.signoz.cloud:443"
- name: OTEL_EXPORTER_OTLP_HEADERS
value: "signoz-ingestion-key=<your-ingestion-key>"
- name: OTEL_SERVICE_NAME
value: "<service-name>"
Replace the following:
<region>: Your SigNoz Cloud region.<your-ingestion-key>: Your SigNoz ingestion key.<service-name>: Name of your service (e.g.,deno-app).
Step 1. Create Dockerfile
Create a Dockerfile in your project root:
FROM deno:2.6.6
WORKDIR /app
# Copy application code
COPY . .
# Start the application
CMD ["deno", "run", "--allow-env", "--allow-net", "app.ts"]
Step 2. Build and run
Set OpenTelemetry environment variables at runtime:
docker run \
-e OTEL_DENO=true \
-e OTEL_EXPORTER_OTLP_ENDPOINT="https://ingest.<region>.signoz.cloud:443" \
-e OTEL_EXPORTER_OTLP_HEADERS="signoz-ingestion-key=<your-ingestion-key>" \
-e OTEL_SERVICE_NAME="<service-name>" \
-p 8000:8000 \
deno-app
Replace the following:
<region>: Your SigNoz Cloud region.<your-ingestion-key>: Your SigNoz ingestion key.<service-name>: Name of your service (e.g.,deno-app).
Step 1. Set environment variables (PowerShell)
$env:OTEL_DENO = "true"
$env:OTEL_EXPORTER_OTLP_ENDPOINT = "https://ingest.<region>.signoz.cloud:443"
$env:OTEL_EXPORTER_OTLP_HEADERS = "signoz-ingestion-key=<your-ingestion-key>"
$env:OTEL_SERVICE_NAME = "<service-name>"
Replace the following:
<region>: Your SigNoz Cloud region.<your-ingestion-key>: Your SigNoz ingestion key.<service-name>: Name of your service (e.g.,deno-app).
Step 2. Run the application
deno run --allow-env --allow-net app.ts
The OTEL_DENO=true flag enables the built-in instrumentation for http, fetch, runtime metrics, and console logs.
Validate
After running your Deno application with OpenTelemetry enabled, you should see traces appearing in SigNoz:
- Navigate to the Services tab in SigNoz
- Look for your service name (the value you set in
OTEL_SERVICE_NAME) - Click on your service to view traces and spans
- You should see spans for HTTP requests handled by
Deno.serveand outgoingfetchcalls - Go to the Logs tab and filter by
service.nameto see console logs - Go to the Dashboards tab to view runtime metrics (e.g.
process.runtime.deno.*or similar)
Troubleshooting
No data in SigNoz
- Ensure
OTEL_DENO=trueis set. - Check that
OTEL_EXPORTER_OTLP_ENDPOINTis correct and includes the protocol (e.g.,https://). - Verify your ingestion key in
OTEL_EXPORTER_OTLP_HEADERS. - Ensure your application runs long enough to export data (OpenTelemetry batches exports).
Console Logs
Deno captures console.log and console.error by default when OTEL_DENO=true. These are exported as logs to OpenTelemetry.
You can configure this behavior with OTEL_DENO_CONSOLE:
capture: Logs are emitted to stdout/stderr AND exported (default).ignore: Logs are ONLY printed to console (not exported).
Setup OpenTelemetry Collector (Optional)
What is the OpenTelemetry Collector?
The OTel Collector acts as a middleman between your app and SigNoz. Instead of sending data directly, your application 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.
For more details, see Why use the OpenTelemetry Collector? and the Collector configuration guide.
Next Steps
- Need to create custom spans or add attributes yourself? Use the Manual Instrumentation in Deno guide once the base setup is in place.
- Explore your traces in SigNoz
- Query and filter traces
- Set up alerts for your Deno service
Get Help
If you need help with the steps in this topic, please reach out to us on SigNoz Community Slack.
If you are a SigNoz Cloud user, please use in product chat support located at the bottom right corner of your SigNoz instance or contact us at cloud-support@signoz.io.