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

Send logs from Node.js Bunyan logger to SigNoz using OpenTelemetry

Prerequisites

Send logs to SigNoz

Auto-instrumentation automatically captures:

  • Bunyan logs with trace correlation
  • HTTP requests (incoming and outgoing)

Step 1: Install dependencies

Install the required OpenTelemetry dependencies:

npm install --save @opentelemetry/api \
  @opentelemetry/auto-instrumentations-node

Step 2: Run the application

Set the environment variables and run your application using the NODE_OPTIONS environment variable:

export OTEL_EXPORTER_OTLP_ENDPOINT="https://ingest.<region>.signoz.cloud:443"
export OTEL_NODE_RESOURCE_DETECTORS="env,host,os"
export OTEL_SERVICE_NAME="<service_name>"
export OTEL_EXPORTER_OTLP_HEADERS="signoz-ingestion-key=<your-ingestion-key>"
export NODE_OPTIONS="--require @opentelemetry/auto-instrumentations-node/register"
node index.js # Replace with your entry file

Replace the following:

  • <service_name>: Your service name.
  • <region>: Your SigNoz Cloud region.
  • <your-ingestion-key>: Your ingestion key.

If using a local OTel Collector (VM), use:

export OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:4318"
export OTEL_NODE_RESOURCE_DETECTORS="env,host,os"
export OTEL_SERVICE_NAME="<service_name>"
# Do not set OTEL_EXPORTER_OTLP_HEADERS when using the local collector
export NODE_OPTIONS="--require @opentelemetry/auto-instrumentations-node/register"
node index.js # Replace with your entry file

Note

By default, auto-instrumentation collects traces and metrics. If you want to collect only logs, you can disable traces and metrics by setting the following environment variables:

export OTEL_TRACES_EXPORTER="none"
export OTEL_METRICS_EXPORTER="none"

Validate Logs

Open your SigNoz instance and navigate to the Logs section to view the logs sent from your application.

Node.js Bunyan Logs
Node.js Bunyan Logs
Node.js Bunyan Logs
Node.js Bunyan Logs Detailed View

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.

Troubleshooting

Why do I see "404 Not Found" errors?

This usually happens if the endpoint URL is incorrect.

  • Cloud: https://ingest.<region>.signoz.cloud:443
  • Self-Hosted: http://localhost:4318

Why are my logs not appearing in SigNoz?

  • Check if the application started successfully and is actually generating logs.
  • Verify your <region> and <SIGNOZ_INGESTION_KEY> are correct.

Next Steps

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.

Last updated: December 1, 2025

Edit on GitHub

Was this page helpful?