This guide provides step-by-step instructions for setting up OpenTelemetry (OTel) instrumentation in your Express.js applications to enable comprehensive observability. OpenTelemetry is an open-source framework that helps you collect telemetry data (such as traces, metrics, and logs) from your app to monitor its performance and health. Once your telemetry data is captured, you can configure an exporter to send it directly to Atatus for advanced monitoring and insights. The process of setting up OpenTelemetry in Express.js involves three key steps: Instrumenting Your Express.js Application: Add the necessary OpenTelemetry components to your Express.js app for trace and metric collection.
Configuring the Exporter: Set up the exporter to send your telemetry data to Atatus.
Validating the Setup: Verify that the configuration is working and that your data is being correctly sent to Atatus.

Sending Telemetry Data to Atatus in Two Ways

Send Telemetry Traces to Atatus Option 1: No Code Automatic Instrumentation (recommended)
Option 2: Code Level Automatic Instrumentation
Send Traces Using the OTel Collector Binary
Option 1: No Code Automatic Instrumentation (recommended)
Option 2: Code Level Automatic Instrumentation

Send Telemetry Traces to Atatus

Option 1: No Code Automatic Instrumentation

  1. Install OpenTelemetry packages
  2. Run your application
You can get the ATATUS_INGESTION_KEY from Settings -> Account Settings -> API Keys in Atatus dashboard.

Option 2: Code Level Automatic Instrumentation

  1. Install OpenTelemetry packages
  2. Create tracing.js file
  3. Run the application with OTEL_EXPORTER_OTLP_HEADERS env as follows

Send Traces Using the OTel Collector Binary:

To collect and send traces to Atatus, it’s recommended to install the OpenTelemetry (OTel) Collector binary. The OTel Collector helps gather logs, host metrics, resource, and infrastructure attributes, enabling richer contextual data and easier signal correlation. For detailed instructions on setting up the OTel Collector binary on your VM, please refer to the official installation guide. Once the Collector is up and running, you can proceed with instrumenting your Java application to start sending telemetry data to Atatus.

Option 1: No Code Automatic Instrumentation

  1. Install OpenTelemetry packages
  2. Run your application
You can get the ATATUS_INGESTION_KEY from Settings -> Account Settings -> API Keys in Atatus dashboard.

Option 2: Code Level Automatic Instrumentation

  1. Install OpenTelemetry packages
  2. Create tracing.js file
  3. Run the application with OTEL_EXPORTER_OTLP_HEADERS env as follows