---
title: Node.js OpenTracing Instrumentation
description: OpenTracing instrumentation for Node.js
breadcrumbs: >-
  Docs > APM > Application Instrumentation > Code-Based Custom Instrumentation >
  OpenTracing Instrumentation Setup > Node.js OpenTracing Instrumentation
---

# Node.js OpenTracing Instrumentation

{% alert level="info" %}
OpenTracing support is based on a deprecated specification. If you want to instrument your code with an open spec, use OpenTelemetry instead. Try [processing data from OpenTelemetry instrumentation in Datadog Tracing Libraries](https://docs.datadoghq.com/tracing/trace_collection/otel_instrumentation/).
{% /alert %}

OpenTracing support is included in the `dd-trace` package.

```javascript
const tracer = require('dd-trace').init()
const opentracing = require('opentracing')

opentracing.initGlobalTracer(tracer)
```

Use the tracer like in any other OpenTracing application.

The following tags are available to override Datadog specific options:

- `service.name`: The service name to be used for the span. The service name from the tracer will be used if this is not provided.
- `resource.name`: The resource name to be used for the span. The operation name will be used if this is not provided.
- `span.type`: The span type to be used for the span. Will fallback to `custom` if not provided.

See [opentracing.io](https://opentracing.io/guides/javascript/) for OpenTracing Node.js usage.
