Skip to main content
Version: 6.x (latest)

Tracing using OpenTelemetry

N|Solid collects OpenTelemetry traces from your processes and shows them in the Tracing view of the N|Solid Console. This page describes the Tracing view, N|Solid's OpenTelemetry support, and how to export traces to other OpenTelemetry Protocol (OTLP) endpoints.

The Tracing view​

Open Tracing from the navigation menu to browse the traces collected from the processes that match the global Filter Bar and Date Range.

To collect traces, enable tracing for your processes. You can do this with the NSOLID_TRACING_ENABLED runtime setting (see Configuration), the Tracing switch in the Dashboard's Dynamic Configuration modal, or the Tracing Enabled action on a single process.

The Tracing view has these parts:

  • Real Time Update: Turn automatic refresh on or off. Set Update Interval: to 10 seconds, 15 seconds, 30 seconds, or 1 minute, or type a value (the minimum is 10 seconds).
  • Latency timeline: A grid of trace activity over a 24-hour window, with span latency (in ms) on the vertical axis. Click a cell to show only the traces in that time and latency range, and click the clear icon on the cell to reset the selection.
  • Results: The number of matching traces. Use View: to show 25, 50, 100, 125, or 150 traces per page, and use the pager to move between pages. Span colors identify HTTP, DNS, and Other spans.

Click a trace to expand it. The expanded trace shows its total Duration, number of Services, Depth, and Total spans, a map of the services involved, and a waterfall of the spans under Service & Operation. Click a span to see its Attributes.

For a description of the span attributes, see Serverless.

OpenTelemetry support​

N|Solid supports these OpenTelemetry features:

Using the JavaScript OpenTelemetry API​

To use the OpenTelemetry APIs directly with N|Solid, see the N|Solid Runtime JS API.

Exporting traces via OTLP​

N|Solid can export traces to any endpoint that supports the OpenTelemetry Protocol (OTLP). It also integrates with the Datadog, Dynatrace, and New Relic endpoints, and can export N|Solid metrics to those vendors without their agents.

You can configure the OTLP endpoint in two ways:

  1. Set the NSOLID_OTLP and NSOLID_OTLP_CONFIG environment variables.
  2. Use one of the other configuration methods the runtime supports. See runtime configuration for details.

NSOLID_OTLP sets the type of endpoint to export traces to. The allowed values are:

  • datadog
  • dynatrace
  • newrelic
  • otlp

NSOLID_OTLP_CONFIG sets the configuration for the selected endpoint type. It's a string containing a JSON object whose format depends on the endpoint type:

Endpoint typeFormat
datadog{"zone": "us" | "eu", "key": "your_datadog_key", "url": "otlp_endpoint_url"}
dynatrace{"site": "your_dynatrace_site", "token": "your_dynatrace_token"}
newrelic{"zone": "us" | "eu", "key": "your_newrelic_key"}
otlp{"url": "otlp_endpoint_url", "protocol": "http" | "grpc"}

For otlp, url is the base URL of the collector; the runtime appends /v1/traces. protocol is optional and defaults to http. If you set NSOLID_OTLP=otlp without NSOLID_OTLP_CONFIG, the runtime uses the standard OpenTelemetry default endpoint and protocol.

This example exports traces to Dynatrace:

NSOLID_TRACING_ENABLED=1 NSOLID_OTLP=dynatrace NSOLID_OTLP_CONFIG='{"site":"<your-dynatrace-site>","token":"<your-dynatrace-token>"}' nsolid my_process.js

External tracing mode (self-hosted)​

A self-hosted N|Solid Console can run in external tracing mode. Set externalTracing = true in the Console configuration file, or set NSOLID_EXTERNAL_TRACING=true (or 1). In this mode, traces don't pass through the Console process; the Tracing view reads traces collected by an OpenTelemetry Collector pipeline instead. The default is false.

warning

In external tracing mode, the Console rejects traces sent over the legacy ZeroMQ transport (NSOLID_COMMAND). Connect your processes with gRPC (NSOLID_GRPC) instead.

NodeSource Support