Skip to content

Releases: DataDog/dd-trace-rb

0.12.0.beta2

28 Feb 20:10
Compare
Choose a tag to compare
0.12.0.beta2 Pre-release
Pre-release

Bugfixes

  • Addresses an issue where loading the ddtrace library after Rails has fully initialized can result in load errors. (#357)

Read the full changeset.

0.12.0.beta1

09 Feb 16:05
fbf203a
Compare
Choose a tag to compare
0.12.0.beta1 Pre-release
Pre-release

New integrations

GraphQL tracing support (#295, docs)

screen shot 2018-02-09 at 10 48 23 am

GraphQL is now supported (version 1.7.9+ is required). To activate the integration, use the following configuration:

Datadog.configure do |c|
  c.use :graphql,
        service_name: 'graphql',
        schemas: [YourSchema]
end

ActiveRecord object instantiation tracing (#311, #334, docs)

GraphQL tracing

ActiveRecord queries can spend significant time instantiating Ruby objects from database queries. This feature adds spans to track object instantiation as a part of a trace. Supported in both Rails and standalone applications that implement ActiveRecord.

Improvements

  • Rack applications now tag their traces with the http.request_id tag, which contains X-Request-Id header value. Great for associating traces with requests in HTTP logs. (#330, #335)

Read the full changeset.

0.11.2

02 Feb 20:14
Compare
Choose a tag to compare

Critical update

In the previous 0.11.1 release the PR #322 removed the Monkey module that was used as a main API to activate libraries and frameworks integrations, and it was entirely replaced with the new API that changes the way how libraries are instrumented.

This release introduces the Monkey API again (#336) as a no-op interface, that prints a deprecation warning in your logs as:

Datadog::Monkey has been REMOVED as of version 0.11.1.
All calls to Datadog::Monkey are no-ops.
*Implementations using Monkey will no longer function*.
Upgrade to the new configuration API using the migration guide here:
https://github.com/DataDog/dd-trace-rb/releases/tag/v0.11.0

The no-op Monkey API will be available for the next releases to avoid issues with partially migrated configurations. This is one of the last breaking changes before moving towards a stable 1.0 release.

Read the full changeset.

0.11.1

29 Jan 17:25
adba5c1
Compare
Choose a tag to compare

New features

  • Addedhttp.base_url tag for Rack applications (#301, #327)
  • Added distributed_tracing option to Sinatra (#325)
  • Added exception_controller option to Rails (#320)

Improvements

  • Decoupled Sinatra and ActiveRecord integrations (#328, #330) (thanks @hawknewton!)
  • Racecar uses preferred ActiveSupport::Notifications strategy (#323 )
  • Removed old monkey patcher, in favor of newer configuration API (#322)

Bugfixes

  • Allow Rails controllers to change resource names (#321)
  • Custom Rails exception controllers no longer report as the resource (#320)

Read the full changeset.

0.11.0

17 Jan 22:02
f44c6b6
Compare
Choose a tag to compare

Thank you to our many contributors for reporting issues, and sharing improvements that have been integrated into release 0.11.0!

@whithajess, @NullVoxPopuli, @skisulli, @jjoos, @nerdrew, @drewbailey, @bentheax, @bramswenson

Breaking changes

  • Tracer configuration API has been changed. The new configuration API replaces the old configuration API (which is no longer available.) Applications using the old API will be required to migrate to the new one (docs)
  • New default names for Rails services. By default the Rails app name is used for the main service. If you use the tracer in multiple Rails applications, you'll have a different service for each one (#264)
  • Rack and Rails are now grouped under the same service name by default. You can split them using the new configuration API (#263)

Please check out our migration guide below for updating your application.

Migration from 0.10.x to 0.11.0

Updating to the new configuration API

Version 0.11.0 brings new changes to how you configure your Datadog tracing integration. In this new version, we've introduced the Datadog.configure function, to simplify configuration for all of your frameworks. This new functionality replaces the old configuration API, and as such, will require you to update your old configuration (that was compatible with versions < 0.11.0) to this new Datadog.configure API.

The following is an example of a Rails initializer, that enabled Rails, Redis, Grape and Net::HTTP integration:

Rails.configuration.datadog_trace = {
  # Tracer
  enabled: true,
  trace_agent_hostname: '127.0.0.1',

  # Rails
  auto_instrument: true,
  default_service: 'rails-app',
  default_controller_service: 'rails-controller',
  default_cache_service: 'rails-cache',
  default_database_service: 'mysql',

  # Redis
  auto_instrument_redis: true,

  # Grape
  auto_instrument_grape: true
}

# Net::HTTP
Datadog::Monkey.patch_module(:http)

# Custom configuration for Redis using the Pin
redis = Redis.new
pin = Datadog::Pin.get_from(redis)
pin.service = 'custom-redis'

To update the library, convert the configuration above with the new one:

Datadog.configure do |c|
  # Tracer
  c.tracer hostname: '127.0.0.1'

  # Rails
  c.use :rails,
        service_name: 'rails-app',
        controller_service: 'rails-controller',
        cache_service: 'rails-cache',
        database_service: 'mysql'

  # Redis
  c.use :redis, service_name: 'custom-redis'

  # Grape
  c.use :grape

  # Net::HTTP
  c.use :http
end

For more details regarding changes to configuration for specific integrations, check out our documentation.

Changing default Rails service names

The old defaults for Rails service names were:

  • Default service: rails-app
  • Controller service: rails-controller
  • Cache service: rails-cache

The new defaults for Rails service names are:

  • Default service: <app name>-app
  • Controller service: <app name>-controller
  • Cache service: <app name>-cache

To keep previous defaults, and continue collecting traces under those previous default service names, add the following to your Datadog configuration:

Datadog.configure do |c|
  c.use :rails, service_name: 'rails-app', controller_service: 'rails-controller', cache_service: 'rails-cache'
end
Merging/splitting Rails services

By default in 0.11.0, the Rails controller service will be merged with the default Rails service, rails-app.

If you wish to keep the Rails controller service separate from the parent application service, add the following to your Datadog configuration:

Datadog.configure do |c|
  # Rails controller will be under `rails-app` service
  c.use :rails, service_name: 'rails-app'

  # Rails controller will be under a different service
  c.use :rails, service_name: 'rails-app', controller_service: 'rails-controller'
end

New integrations

  • Support for Redis 4.0+ (#305)
  • Support for Racecar (#268)

Improvements

  • Change the Redis service name (#135 -- thanks @BaneOfSerenity, @nerdrew)
  • Added cached tag for ActiveRecord (#291)
  • Added rails.db.name tag for ActiveRecord (#270)
  • Added out.host and out.port tag for ActiveRecord (#288)
  • Improve rack resource names (#285)
  • Added script_name to Sinatra resource (#283 -- thanks @jamiehodge)
  • Support custom configuration per Faraday connection (#266)

Bugfixes

  • Set span types for integrations (#286)
  • Added safeguard for binary metadata in Dalli (#267)
  • Reduced memory consumption for long Rails cache keys (#284)
  • Drop invalid byte sequences for Redis (#289)
  • Fixed dropped traces for Rails views with nested partials (#302)
  • Fixed ActiveRecord::ConnectionNotEstablished message in logs for ActiveRecord applications that fork (#304)
  • Fixed UTF-8 encoding issue raising errors (#316)

Read the full changeset.

0.11.0 (beta2)

17 Jan 15:02
Compare
Choose a tag to compare
0.11.0 (beta2) Pre-release
Pre-release

Configuration system

This pre-release includes breaking changes for our configuration system and adds new experimental integrations for our library. The documentation will be updated in the stable release.

0.11.0 (beta1)

17 Jan 15:01
Compare
Choose a tag to compare
0.11.0 (beta1) Pre-release
Pre-release

Configuration system

This pre-release includes breaking changes for our configuration system. Our documentation will be updated in the stable release.

0.10.0

30 Nov 11:10
043a193
Compare
Choose a tag to compare

Distributed Sampling (beta)

New feature that propagates the sampling priority across services. This ensures traces are always consistent and complete when distributed tracing is used. This new functionality requires at least the Datadog Agent 5.19+. Frameworks and libraries with out-of-the-box propagation are: Rack, Rails, Sinatra, net/http and Faraday (#248, #245, #229, #249, #254, docs)

Improvements

  • [core] add Datadog::Registry for better configuration API (#200)
  • [core] add Configuration API for integrations (#203)
  • [core] migrate http to new configuration API (#225)
  • [core] make HTTPTransport compatible with multiple API versions (#228)
  • [core] improve shutdown process (#253)

New configuration

Introduced a new experimental API that is available for some integrations. The API is still experimental and will be fully available in the next major release (0.11.0). In the meantime you can check some examples for the following integrations:

  • Rails (#224)
  • Sinatra (#226, #260, docs)
  • Sidekiq still use the previous API, though some changes have been done to support the new API (#227)

Bugfixes

  • [redis] Updates Redis integration tag/metric (#216)
  • [core] handle integrations that don't implement #patch (#241)
  • [resque] removing useless waits when a job ends, using a synchronous writer so the trace is flushed immediately before exiting the process (#252)

!! Breaking changes !!
[sinatra] introducing a new API that replaces the previous approach. This version changed the following:

  • default_service has been renamed service_name
  • you don't use datadog_tracer configuration object, but directly the new Datadog#configure

If you have a configuration like:

configure do
  settings.datadog_tracer.configure default_service: 'my-app', trace_agent_hostname: 'ddagent'
end

now it must be:

Datadog.configure do |c|
  c.use :sinatra, service_name: 'my-app', trace_agent_hostname: 'ddagent'
end

Read the full changeset

0.9.2

03 Nov 12:14
Compare
Choose a tag to compare

Bugfixes

  • [rails] fixed error reporting when exceptions happen in the cache layer (#244)

Read the full changeset.

0.9.1

02 Nov 16:10
Compare
Choose a tag to compare

Improvements

  • [rails] use direct instrumentation instead of Rails built-in instrumentation avoiding a level of indirection (#235)
  • [core] remove debug logging when the Pin instance is retrieved, removing the time spent in this critical path (#233)
  • [core] add an exponential back-off to our flushing strategy so that the thread will flush less often if the Trace Agent is not available (#239)
  • [core] remove duplicate filter on Trace#trace (#234)

Bugfixes

  • [resque] safe-guard if the Pin is nil (#223, #242 -- thanks @drewbailey)
  • [resque] cleanup the current Context after the process fork to avoid useless Copy-on-Write (#231)

Read the full changeset