Upgrading datadog

September 17, 2024 ยท View on GitHub

From 0.x to 1.0

Upgrading ddtrace from 0.x to 1.x introduces some breaking changes which are outlined below.

How to upgrade basic usage

For users with a basic implementation (configuration file + out-of-the-box instrumentation), only minor changes to your configuration file are required: most applications take just minutes to update. Check out the following sections for a step-by-step guide.

Additional upgrades for advanced usage

For users with an advanced implementation of ddtrace (custom instrumentation, sampling or processing behavior, etc), some additional namespace and behavioral changes may be required. See the following sections for details about what features changed and how to use them.

Appendix

For a comprehensive list of everything that changed, the appendix hosts some helpful and detailed tables with recommendations.

Upgrading basic usage

Configuration

`require` paths have changed

If you require any of the following paths, update them accordingly:

0.x require path1.0 require path
ddtrace/opentelemetryRemoved
ddtrace/opentracerdatadog/opentracer
ddtrace/profiling/preloaddatadog/profiling/preload

Using require 'ddtrace' will load all features by default. To load individual features, you may use the following paths instead:

Feature1.0 require path
AppSecdatadog/appsec
CIdatadog/ci
OpenTracingdatadog/opentracer
Profilingdatadog/profiling
Tracingdatadog/tracing

Settings have been renamed

Configuration settings have been sorted into smaller configuration groups, by feature.

  • Datadog.configure { |c| c.* }: Datadog configuration settings
  • Datadog.configure { |c| c.tracing.* }: Tracing configuration settings
  • Datadog.configure { |c| c.profiling.* }: Profiling configuration settings
  • Datadog.configure { |c| c.ci.* }: CI configuration settings

For existing applications, configuration files should be updated accordingly. For example:

# config/initializers/datadog.rb
require 'ddtrace'

### Old 0.x ###
Datadog.configure do |c|
  # Global settings
  c.tracer.hostname = '127.0.0.1'
  c.tracer.port = 8126
  c.runtime_metrics_enabled = true
  c.service = 'billing-api'

  # Tracing settings
  c.analytics.enabled = true
  c.tracer.partial_flush.enabled = true

  # CI settings
  c.ci_mode = (ENV['DD_ENV'] == 'ci')

  # Instrumentation
  c.use :rails
  c.use :redis, service_name: 'billing-redis'
  c.use :rspec
end


### New 1.0 ###
Datadog.configure do |c|
  # Global settings
  c.agent.host = '127.0.0.1'
  c.agent.port = 8126
  c.runtime_metrics.enabled = true
  c.service = 'billing-api'

  # Tracing settings
  c.tracing.analytics.enabled = true
  c.tracing.partial_flush.enabled = true

  # CI settings
  c.ci.enabled = (ENV['DD_ENV'] == 'ci')

  # Instrumentation
  c.tracing.instrument :rails
  c.tracing.instrument :redis, service_name: 'billing-redis'
  c.ci.instrument :rspec
end

Check out the table below for a list of common mappings:

0.x setting1.0 setting
analytics.enabledtracing.analytics.enabled
ci_mode.context_flushci.context_flush
ci_mode.enabledci.enabled
ci_mode.writer_optionsci.writer_options
distributed_tracingtracing.distributed_tracing
logger=logger.instance=
profiling.exporter.transport_optionsRemoved
report_hostnametracing.report_hostname
runtime_metrics_enabledruntime_metrics.enabled
runtime_metrics(options)Removed
samplingtracing.sampling
test_modetracing.test_mode
tracer=Removed
tracer.debugdiagnostics.debug
tracer.enabledtracing.enabled
tracer.envenv
tracer.hostnameagent.host
tracer.instancetracing.instance
tracer.loglogger.instance
tracer.partial_flushtracing.partial_flush.enabled
tracer.portagent.port
tracer.samplertracing.sampler
tracer.tagstags
tracer.transport_optionstracing.transport_options
tracer.transport_options(options)Removed
tracer.writertracing.writer
tracer.writer_optionstracing.writer_options
usetracing.instrument

Activating instrumentation

  • The use function has been renamed to instrument.
  • instrument has been namespaced within the feature to which it belongs.

As an example:

### Old 0.x ###
Datadog.configure do |c|
  # Tracing instrumentation
  c.use :rails

  # CI instrumentation
  c.use :cucumber
end


### New 1.0 ###
Datadog.configure do |c|
  # Tracing instrumentation
  c.tracing.instrument :rails

  # CI instrumentation
  c.ci.instrument :cucumber
end

Similarly, if you were accessing configuration for instrumentation, you will need to use the appropriate namespace:

### Old 0.x ###
Datadog.configuration[:rails][:service_name]
Datadog.configuration[:cucumber][:service_name]

### New 1.0 ###
Datadog.configuration.tracing[:rails][:service_name]
Datadog.configuration.ci[:cucumber][:service_name]

Instrumentation

Service naming

Define an application service name

We recommend setting the application's service name with DD_SERVICE, or by adding the following configuration:

Datadog.configure do |c|
  c.service = 'billing-api' # Or DD_SERVICE. Defaults to process name.
end

If this is not set, it will default to the process name.

Update service names for your integrations

Spans now inherit the global service name by default, unless otherwise explicitly set. This means, generally speaking, spans generated by Datadog integrations will default to the global service name, unless the service_name setting is configured for that integration.

Spans that describe external services (e.g. mysql) will continue to default to some other name that describes the external service instead. (e.g. mysql)

### Old 0.x ###
Datadog.configure do |c|
  # Instrumentation that measures internal behavior
  c.use :rails, service_name: 'billing-api'
  c.use :resque, service_name: 'billing-api'
  c.use :sidekiq, service_name: 'billing-api'

  # Instrumentation that measures external services
  c.use :active_record, service_name: 'billing-api_mysql' # Defaults to DB type e.g. mysql
  c.use :http, service_name: 'billing-api_http' # Defaults to net/http
  c.use :redis, service_name: 'billing-api_redis' # Defaults to redis
end

### New 1.0 ###
Datadog.configure do |c|
  c.service = 'billing-api'

  # Instrumentation that measures internal behavior
  # now inherits the application's service name.
  c.tracing.instrument :rails
  c.tracing.instrument :resque
  c.tracing.instrument :sidekiq

  # Instrumentation that measures external services
  # defaults to adapter-specific names. You may still override
  # these names with the `service_name:` option.
  c.tracing.instrument :active_record, service_name: 'billing-api_mysql' # Defaults to DB type e.g. mysql
  c.tracing.instrument :http, service_name: 'billing-api_http' # Defaults to net/http
  c.tracing.instrument :redis, service_name: 'billing-api_redis' # Defaults to redis
end

Update Rails instrumentation

If your application activates and configures rails instrumentation, you will need to adjust your settings slightly.

The following options have been removed; instead, configure the underlying instrumentation directly.

0.x setting1.0 setting
use :rails, cache_service: <SERVICE>tracing.instrument :active_support, cache_service: <SERVICE>
use :rails, controller_service: <SERVICE>tracing.instrument :action_pack, service_name: <SERVICE>
use :rails, database_service: <SERVICE>tracing.instrument :active_record, service_name: <SERVICE>
use :rails, job_service: <SERVICE>tracing.instrument :active_job, service_name: <SERVICE>
use :rails, log_injection: truetracing.log_injection = true (Is true by default.)
### Old 0.x ###
Datadog.configure do |c|
  c.use :rails, service_name: 'billing-api',
                cache_service: 'billing-api-cache',
                controller_service: 'billing-api-controllers',
                database_service: 'billing-api-db',
                job_service: 'billing-api-jobs',
                log_injection: true
end

### New 1.0 ###
Datadog.configure do |c|
  c.service = 'billing-api'

  c.tracing.instrument :rails
  c.tracing.instrument :active_support, cache_service: 'billing-api-cache'
  c.tracing.instrument :action_pack, service_name: 'billing-api-controllers'
  c.tracing.instrument :active_record, service_name: 'billing-api-db'
  c.tracing.instrument :active_job, service_name: 'billing-api-jobs'
end

Upgrading advanced usage

Namespacing

Many files and constants within ddtrace have been recategorized by feature. The new categorization scheme is as follows:

FeatureNamespaceFile path
GlobalsDatadogddtrace
CIDatadog::CIdatadog/ci
Core (Internals)Datadog::Coredatadog/core
OpenTelemetryDatadog::OpenTelemetrydatadog/opentelemetry
OpenTracingDatadog::OpenTracerdatadog/opentracer
ProfilingDatadog::Profilingdatadog/profiling
SecurityDatadog::AppSecdatadog/appsec
TracingDatadog::Tracingdatadog/trace

As a result, if your application referenced file paths or constants affected by this change, they will need to be updated. Check out the namespace mappings for some common cases and how to update them.

Trace API

Usage of Datadog.tracer has been replaced with the Datadog::Tracing trace API. This module contains most of the functions that Datadog.tracer had, and most use cases will map one-to-one.

For example:

### Old 0.x ###
Datadog.tracer.trace
Datadog.tracer.active_span
Datadog.tracer.active_correlation.to_s


### New 1.0 ###
Datadog::Tracing.trace
Datadog::Tracing.active_span
Datadog::Tracing.log_correlation

# ...and more...

See the table below for most common mappings:

0.x usage1.0 usageNote
Datadog.tracer.active_correlation.to_sDatadog::Tracing.log_correlationReturns String with trace identifiers for logging.
Datadog.tracer.active_correlationDatadog::Tracing.correlationReturns Datadog::Tracing::Correlation::Identifier
Datadog.tracer.active_root_spanRemovedConsider Datadog::Tracing.active_trace instead.
Datadog.tracer.active_span.context.sampling_priority = Datadog::Ext::Priority::USER_KEEPDatadog::Tracing.keep!See sampling for details.
Datadog.tracer.active_span.context.sampling_priority = Datadog::Ext::Priority::USER_REJECTDatadog::Tracing.reject!See sampling for details.
Datadog.tracer.active_span.contextRemovedConsider Datadog::Tracing.active_trace instead.
Datadog.tracer.active_spanDatadog::Tracing.active_spanSee trace state for details.
Datadog.tracer.call_contextRemovedSee trace state for details.
Datadog.tracer.configure(options)Datadog.configure { |c| ... }Use configuration API instead.
Datadog.tracer.provider.context = contextDatadog::Tracing.continue_trace!(digest)See distributed tracing for details.
Datadog.tracer.set_tags(tags)Datadog.configure { |c| c.tags = tags }
Datadog.tracer.shutdown!Datadog::Tracing.shutdown!
Datadog.tracer.start_spanDatadog::Tracing.traceSee manual tracing for details.
Datadog.tracer.traceDatadog::Tracing.traceSee manual tracing for details.

Also check out the functions defined within Datadog::Tracing in our public API for more details on their usage.

Removed `Datadog.tracer`

Many of the functions accessed directly through Datadog.tracer have been moved to Datadog::Tracing instead.

Removed access to `Datadog::Context`

Direct usage of Datadog::Context has been removed. Previously, it was used to modify or access active trace state. Most use cases have been replaced by our public trace API.

Manual tracing & trace model

Manual tracing is now done through the public API.

Whereas in 0.x, the block would provide a Datadog::Span as span, in 1.0, the block provides a Datadog::Tracing::SpanOperation as span and Datadog::Tracing::TraceOperation as trace.

### Old 0.x ###
Datadog.tracer.trace('my.job') do |span|
  # Do work...
  # span => #<Datadog::Tracing::Span>
end


### New 1.0 ###
Datadog::Tracing.trace('my.job') do |span, trace|
  # Do work...
  # span => #<Datadog::Tracing::SpanOperation>
  # trace => #<Datadog::Tracing::TraceOperation>
end

The provided span is nearly identical in behavior, except access to some fields (like context) been removed. Instead, the provided trace, which models the trace itself, grants access to new functions, of which some replace old span behavior.

For more details about new behaviors and the trace model, see this pull request.

Accessing trace state

The public API provides new functions to access active trace data:

### Old 0.x ###
# Returns the active context (contains trace state)
Datadog.tracer.call_context
# Returns the active Span
Datadog.tracer.active_span
# Returns an immutable set of identifiers for the current trace state
Datadog.tracer.active_correlation


### New 1.0 ###
# Returns the active TraceOperation for the current thread (contains trace state)
Datadog::Tracing.active_trace
# Returns the active SpanOperation for the current thread (contains span state)
Datadog::Tracing.active_span
# Returns an immutable set of identifiers for the current trace state
Datadog::Tracing.correlation

Use of active_root_span has been removed.

Distributed tracing

Previously, distributed tracing required building new Datadog::Context objects, then replacing the context within the tracer.

Instead, users must use TraceDigest objects derived from a trace. TraceDigest represents the state of a trace. It can be used to propagate a trace across execution boundaries (processes, threads) or to continue a trace locally.

### Old 0.x ###
# Get trace continuation from active trace
env = {}
Datadog::HTTPPropagator.inject(Datadog.tracer.call_context, env)
context = Datadog::HTTPPropagator.extract(env)

# Continue a trace: implicit continuation
Datadog.tracer.provider.context = context

# Next trace inherits trace properties
Datadog.tracer.trace('my.job') do |span|
  span.trace_id == context.trace_id
end


### New 1.0 ###
# Get trace continuation from active trace
trace_digest = Datadog::Tracing.active_trace.to_digest

# Continue a trace: implicit continuation
# Digest will be "consumed" by the next `trace` operation
Datadog::Tracing.continue_trace!(trace_digest)

# Next trace inherits trace properties
Datadog::Tracing.trace('my.job') do |span, trace|
  trace.id == trace_digest.trace_id
end

# Second trace does NOT inherit trace properties
Datadog::Tracing.trace('my.job') do |span, trace|
  trace.id != trace_digest.trace_id
end

New in 1.0, it's also possible to explicitly assign a trace block to continue from a specific trace, rather than implicitly inherit an active context. This gives users fine-grained control in applications where multiple traces run concurrently in the same execution context:

### New 1.0 ###
# Get trace continuation from active trace
trace_digest = Datadog::Tracing.active_trace.to_digest

# Continue a trace: explicit continuation
# Inherits trace properties from the trace digest
Datadog::Tracing.trace('my.job', continue_from: trace_digest) do |span, trace|
  trace.id == trace_digest.trace_id
end

# Continue a trace: explicit continuation (using #continue_trace!)
Datadog::Tracing.continue_trace!(trace_digest) do
  # Traces implicitly continue within the block
  Datadog::Tracing.trace('my.job') do |span, trace|
    trace.id == trace_digest.trace_id
  end
end

Over HTTP

To propagate active trace to a remote service:

### Old 0.x ###
headers = {}
context = Datadog.tracer.call_context
Datadog::HTTPPropagator.inject!(context, headers)

outgoing = Net::HTTP::Get.new(uri)
headers.each { |name, value| outgoing[name] = value }

### New 1.0 ###
headers = {}
trace_digest = Datadog::Tracing.active_trace.to_digest
Datadog::Tracing::Propagation::HTTP.inject!(trace_digest, headers)

outgoing = Net::HTTP::Get.new(uri)
headers.each { |name, value| outgoing[name] = value }

To continue a trace from a remote service:

### Old 0.x ###
incoming = Rack::Request.new(env)
context = Datadog::HTTPPropagator.extract(incoming.env)
Datadog.tracer.provider.context = context

### New 1.0 ###
incoming = Rack::Request.new(env)
trace_digest = Datadog::Tracing::Propagation::HTTP.extract(incoming.env)
Datadog::Tracing.continue_trace!(trace_digest)

Over gRPC

To propagate active trace to a remote service:

### Old 0.x ###
context = Datadog.tracer.call_context
Datadog::GRPCPropagator.inject!(context, metadata)

### New 1.0 ###
trace_digest = Datadog::Tracing.active_trace.to_digest
Datadog::Tracing::Propagation::GRPC.inject!(trace_digest, metadata)

To continue a trace from a remote service:

### Old 0.x ###
context = Datadog::GRPCPropagator.extract(metadata)
Datadog.tracer.provider.context = context

### New 1.0 ###
trace_digest = Datadog::Tracing::Propagation::GRPC.extract(metadata)
Datadog::Tracing.continue_trace!(trace_digest)

Between threads

Traces do not implicitly propagate across threads, as they are considered different execution contexts.

However, if you wish to do this, trace propagation across threads is similar to cross-process. A TraceDigest should be produced by the parent thread and consumed by the child thread.

NOTE: The same TraceOperation object should never be shared between threads; this would create race conditions.

### New 1.0 ###
# Get trace digest
trace = Datadog::Tracing.active_trace

# NOTE: We must produce the digest BEFORE starting the thread.
#       Otherwise if it's lazily evaluated within the thread,
#       the thread's trace may follow the wrong parent span.
trace_digest = trace.to_digest

Thread.new do
  # Inherits trace properties from the trace digest
  Datadog::Tracing.trace('my.job', continue_from: trace_digest) do |span, trace|
    trace.id == trace_digest.trace_id
  end
end

Sampling

Accessing call_context to set explicit sampling has been removed.

Instead, use the TraceOperation to set the sampling decision.

### Old 0.x ###
# From within the trace:
Datadog.tracer.trace('web.request') do |span|
  span.context.sampling_priority = Datadog::Ext::Priority::USER_REJECT if env.path == '/healthcheck'
end

# From outside the trace:
# Keeps current trace
Datadog.tracer.active_span.context.sampling_priority = Datadog::Ext::Priority::USER_KEEP
# Drops current trace
Datadog.tracer.active_span.context.sampling_priority = Datadog::Ext::Priority::USER_REJECT


### New 1.0 ###
# From within the trace:
Datadog::Tracing.trace('web.request') do |span, trace|
  trace.reject! if env.path == '/healthcheck'
end

# From outside the trace:
Datadog::Tracing.keep! # Keeps current trace
Datadog::Tracing.reject! # Drops current trace

Processing pipeline

When using a trace processor in the processing pipeline, the block provides a TraceSegment as trace (instead of Array[Datadog::Span].) This object can be directly mutated.

### Old 0.x ###
Datadog::Pipeline.before_flush do |trace|
  # Processing logic...
  trace # => Array[Datadog::Span]
end


### New 1.0 ###
Datadog::Tracing.before_flush do |trace|
   # Processing logic...
   trace # => #<Datadog::Tracing::TraceSegment>
end

Appendix

Namespace mappings

Constants

0.x Constant1.0 Constant
Datadog::AllSamplerDatadog::Tracing::Sampling::AllSampler
Datadog::BufferDatadog::Core::Buffer::Random
Datadog::ChunkerDatadog::Core::Chunker
Datadog::ConfigurationDatadog::Core::Configuration
Datadog::ContextFlushDatadog::Tracing::Flush
Datadog::CRubyBufferDatadog::Core::Buffer::CRuby
Datadog::DiagnosticsDatadog::Core::Diagnostics
Datadog::DistributedTracingDatadog::Tracing::Distributed
Datadog::EncodingDatadog::Core::Encoding
Datadog::ErrorDatadog::Core::Error
Datadog::Ext::Analytics::ENV_TRACE_ANALYTICS_ENABLEDDatadog::Tracing::Configuration::Ext::Analytics::ENV_TRACE_ANALYTICS_ENABLED
Datadog::Ext::AnalyticsDatadog::Tracing::Metadata::Ext::Analytics
Datadog::Ext::AppTypesDatadog::Tracing::Metadata::Ext::AppTypes
Datadog::Ext::Correlation::ENV_LOGS_INJECTION_ENABLEDDatadog::Tracing::Configuration::Ext::Correlation::ENV_LOGS_INJECTION_ENABLED
Datadog::Ext::CorrelationDatadog::Tracing::Correlation::Identifier
Datadog::Ext::DiagnosticsDatadog::Core::Diagnostics::Ext
Datadog::Ext::Distributed::ENV_PROPAGATION_STYLE_EXTRACTDatadog::Tracing::Configuration::Ext::Distributed::ENV_PROPAGATION_STYLE_EXTRACT
Datadog::Ext::Distributed::ENV_PROPAGATION_STYLE_INJECTDatadog::Tracing::Configuration::Ext::Distributed::ENV_PROPAGATION_STYLE_INJECT
Datadog::Ext::Distributed::PROPAGATION_STYLE_B3_SINGLE_HEADERDatadog::Tracing::Configuration::Ext::Distributed::PROPAGATION_STYLE_B3_SINGLE_HEADER
Datadog::Ext::Distributed::PROPAGATION_STYLE_B3Datadog::Tracing::Configuration::Ext::Distributed::PROPAGATION_STYLE_B3
Datadog::Ext::Distributed::PROPAGATION_STYLE_DATADOGDatadog::Tracing::Configuration::Ext::Distributed::PROPAGATION_STYLE_DATADOG
Datadog::Ext::DistributedDatadog::Tracing::Metadata::Ext::Distributed
Datadog::Ext::DistributedTracing::TAG_ORIGINDatadog::Tracing::Metadata::Ext::Distributed::TAG_ORIGIN
Datadog::Ext::DistributedTracing::TAG_SAMPLING_PRIORITYDatadog::Tracing::Metadata::Ext::Distributed::TAG_SAMPLING_PRIORITY
Datadog::Ext::DistributedTracingDatadog::Tracing::Distributed::Headers::Ext
Datadog::Ext::EnvironmentDatadog::Core::Environment::Ext
Datadog::Ext::ErrorsDatadog::Tracing::Metadata::Ext::Errors
Datadog::Ext::GitDatadog::Core::Git::Ext
Datadog::Ext::HTTPDatadog::Tracing::Metadata::Ext::HTTP
Datadog::Ext::IntegrationDatadog::Tracing::Metadata::Ext
Datadog::Ext::NET::ENV_REPORT_HOSTNAMEDatadog::Tracing::Configuration::Ext::NET::ENV_REPORT_HOSTNAME
Datadog::Ext::NETDatadog::Tracing::Metadata::Ext::NET
Datadog::Ext::PriorityDatadog::Tracing::Sampling::Ext::Priority
Datadog::Ext::RuntimeDatadog::Core::Runtime::Ext
Datadog::Ext::Sampling::ENV_RATE_LIMITDatadog::Tracing::Configuration::Ext::Sampling::ENV_RATE_LIMIT
Datadog::Ext::Sampling::ENV_SAMPLE_RATEDatadog::Tracing::Configuration::Ext::Sampling::ENV_SAMPLE_RATE
Datadog::Ext::SamplingDatadog::Tracing::Metadata::Ext::Sampling
Datadog::Ext::SQLDatadog::Tracing::Metadata::Ext::SQL
Datadog::Ext::TestDatadog::Tracing::Configuration::Ext::Test
Datadog::Ext::Transport::HTTP::ENV_DEFAULT_HOSTDatadog::Core::Configuration::Ext::Transport::ENV_DEFAULT_HOST
Datadog::Ext::Transport::HTTP::ENV_DEFAULT_PORTDatadog::Tracing::Configuration::Ext::Transport::ENV_DEFAULT_PORT
Datadog::Ext::Transport::HTTP::ENV_DEFAULT_URLDatadog::Tracing::Configuration::Ext::Transport::ENV_DEFAULT_URL
Datadog::Ext::TransportDatadog::Transport::Ext
Datadog::GRPCPropagatorDatadog::Tracing::Propagation::GRPC
Datadog::HTTPPropagatorDatadog::Tracing::Propagation::HTTP
Datadog::LoggerDatadog::Core::Logger
Datadog::MetricsDatadog::Core::Metrics::Client
Datadog::PrioritySamplerDatadog::Tracing::Sampling::PrioritySampler
Datadog::QuantizationDatadog::Contrib::Utils::Quantization
Datadog::RateByKeySamplerDatadog::Tracing::Sampling::RateByKeySampler
Datadog::RateByServiceSamplerDatadog::Tracing::Sampling::RateByServiceSampler
Datadog::RateSamplerDatadog::Tracing::Sampling::RateSampler
Datadog::RuntimeDatadog::Core::Runtime
Datadog::SamplerDatadog::Tracing::Sampling::Sampler
Datadog::Tagging::AnalyticsDatadog::Tracing::Metadata::Analytics
Datadog::Tagging::MetadataDatadog::Tracing::Metadata::Tagging
Datadog::ThreadSafeBufferDatadog::Core::Buffer::ThreadSafe
Datadog::UtilsDatadog::Core::Utils
Datadog::Vendor::ActiveRecordDatadog::Contrib::ActiveRecord::Vendor
Datadog::Vendor::MultipartDatadog::Core::Vendor::Multipart
Datadog::WorkerDatadog::Core::Worker
Datadog::WorkersDatadog::Core::Workers

Breaking changes

CategoryTypeDescriptionChange / Alternative
GeneralChangedMany constants have been moved from Datadog to Datadog::Core, Datadog::TracingUpdate your references to these new namespaces where appropriate.
GeneralChangedSome require paths have been moved from ddtrace to datadogUpdate your references to these new paths where appropriate.
GeneralRemovedSupport for trace agent API v0.2Use v0.4 instead (default behavior.)
GeneralRemovedDatadog.configure can no longer be called without a blockRemove uses of Datadog.configure without a block.
CI APIChangedDD_TRACE_CI_MODE_ENABLED environment variable is now DD_TRACE_CI_ENABLEDUse DD_TRACE_CI_ENABLED instead.
ConfigurationChangedMany settings have been namespaced under specific categoriesUpdate your configuration to these new settings where appropriate.
ConfigurationRemovedDatadog.configure(client, options)Use Datadog.configure_onto(client, options) instead.
ConfigurationRemovedDD_#{integration}_ANALYTICS_ENABLED and DD_#{integration}_ANALYTICS_SAMPLE_RATE environment variablesUse DD_TRACE_#{integration}_ANALYTICS_ENABLED and DD_TRACE_#{integration}_ANALYTICS_SAMPLE_RATE instead.
ConfigurationRemovedDD_PROPAGATION_INJECT_STYLE and DD_PROPAGATION_EXTRACT_STYLE environment variablesUse DD_TRACE_PROPAGATION_STYLE_INJECT and DD_TRACE_PROPAGATION_STYLE_EXTRACT instead.
IntegrationsChanged- in HTTP header tag names are kept, and no longer replaced with _For example: http.response.headers.content_type is changed to http.response.headers.content-type.
IntegrationsChangedContrib::Configurable#default_configuration moved to Tracing::Contrib::Configurable#new_configurationUse Tracing::Contrib::Configurable#new_configuration instead.
IntegrationsChangedDatadog.configuration.registry moved to Datadog.registryUse Datadog.registry instead.
IntegrationsChangedservice_name option from each integration uses the default service name, unless it represents an external serviceSet c.service or DD_SERVICE, and remove service_name option from integration to inherit default service name. Set service_name option on integration to override.
IntegrationsRemovedtracer integration option from all integrationsRemove this option from your configuration.
Integrations - ActiveJobRemovedlog_injection optionUse c.tracing.log_injection instead.
Integrations - ActiveModelSerializersRemovedservice_name configurationRemove this option from your configuration.
Integrations - ConcurrentRubyRemovedunused option service_nameRemove this option from your configuration.
Integrations - PrestoChangedout.host tag now contains only client hostname. Before it contained "#{hostname}:#{port}".
Integrations - RailsChangedservice_name does not propagate to sub-components (e.g. c.use :rails, cache_service: 'my-cache')Use c.service instead.
Integrations - RailsChangedSub-components service_name options are now consistently called :service_nameUpdate your configuration to use :service_name.
Integrations - RailsChangedTrace-logging correlation is enabled by defaultCan be disabled using the environment variable DD_LOGS_INJECTION=false.
Integrations - RailsRemovedlog_injection option.Use global c.tracing.log_injection instead.
Integrations - RailsRemovedorm_service_name option.Remove this option from your configuration.
Integrations - RailsRemoved3.0 and 3.1 support.Not supported.
Integrations - ResqueRemovedworkers option. (All Resque workers are now automatically instrumented.)Remove this option from your configuration.
Tracing APIChangedCorrelation#to_s to Correlation#to_log_formatUse Datadog::Tracing.log_correlation instead.
Tracing APIChangedTracer#trace implements keyword argsOmit invalid options from trace calls.
Tracing APIChangedDistributed tracing takes and returns TraceDigest instead of ContextUpdate your usage of distributed tracing to use continue_from and to_digest.
Tracing APIChangedRules for RuleSampler now return TraceOperation instead of SpanUpdate Rule sampler usage to use TraceOperation.
Tracing APIChangedTrace processors return TraceSegment instead of Array[Span]Update pipeline callbacks to use `TraceSegment instead.
Tracing APIRemovedchild_of: option from Tracer#traceNot supported.
Tracing APIRemovedDatadog.tracerUse methods in Datadog::Tracing instead.
Tracing APIRemovedPin.get_from(client)Use Datadog::Tracing.configure_for(client) instead.
Tracing APIRemovedPin.new(service, config: { option: value }).onto(client)Use Datadog.configure_onto(client, service_name: service, option: value) instead.
Tracing APIRemovedPipeline.before_flushUse Datadog::Tracing.before_flush instead.
Tracing APIRemovedSpanOperation#contextUse Datadog::Tracing.active_trace instead.
Tracing APIRemovedSpanOperation#parent/SpanOperation#parent=Not supported.
Tracing APIRemovedSpanOperation#sampledUse Datadog::Tracing::TraceOperation#sampled? instead.
Tracing APIRemovedTracer#active_correlation.to_log_formatUse Datadog::Tracing.log_correlation instead.
Tracing APIRemovedTracer#active_correlationUse Datadog::Tracing.correlation instead.
Tracing APIRemovedTracer#active_root_spanUse Datadog::Tracing.active_trace instead.
Tracing APIRemovedTracer#build_spanUse Datadog::Tracing.trace instead.
Tracing APIRemovedTracer#call_contextUse Datadog::Tracing.active_trace instead.
Tracing APIRemovedTracer#configureNot supported.
Tracing APIRemovedTracer#servicesNot supported.
Tracing APIRemovedTracer#set_service_infoNot supported.
Tracing APIRemovedTracer#start_spanUse Datadog::Tracing.trace instead.
Tracing APIRemovedWriter#write and SyncWriter#write services argumentNot supported.