Skip to content

0.11.0

Compare
Choose a tag to compare
@palazzem palazzem released this 17 Jan 22:02
· 11586 commits to master since this release
f44c6b6

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.