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

# Ruby 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/ruby.md).
{% /alert %}

To set up Datadog with OpenTracing, see the Ruby [Quickstart for OpenTracing](https://docs.datadoghq.com/tracing/setup/ruby.md#quickstart-for-opentracing) for details.

## Configuring Datadog tracer settings{% #configuring-datadog-tracer-settings %}

The underlying Datadog tracer can be configured by passing options (which match `Datadog::Tracer`) when configuring the global tracer:

```ruby
# Where `options` is a Hash of options provided to Datadog::Tracer
OpenTracing.global_tracer = Datadog::OpenTracer::Tracer.new(options)
```

It can also be configured by using `Datadog.configure` as described in the [Ruby tracer settings](https://docs.datadoghq.com/tracing/setup/ruby.md#tracer-settings) section.

## Activating and configuring integrations{% #activating-and-configuring-integrations %}

By default, configuring OpenTracing with Datadog does not automatically activate any additional instrumentation provided by Datadog. You will only receive [spans](https://docs.datadoghq.com/tracing/glossary.md#spans) and [traces](https://docs.datadoghq.com/tracing/glossary.md#trace) from OpenTracing instrumentation you have in your application.

However, additional instrumentation provided by Datadog can be activated alongside OpenTracing using `Datadog.configure`, which can be used to enhance your tracing further. To enable this, see [Ruby integration instrumentation](https://docs.datadoghq.com/tracing/setup/ruby.md#integration-instrumentation) for more details.

## Supported serialization formats{% #supported-serialization-formats %}

| Type                           | Supported? | Additional information                                                                                                                                                                                                                                                                                        |
| ------------------------------ | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `OpenTracing::FORMAT_TEXT_MAP` | Yes        |
| `OpenTracing::FORMAT_RACK`     | Yes        | Because of the loss of resolution in the Rack format, note that baggage items with names containing either upper case characters or `-` are be converted to lower case and `_` in a round-trip, respectively. Datadog recommends avoiding these characters or accommodating accordingly on the receiving end. |
| `OpenTracing::FORMAT_BINARY`   | No         |
