Skip to content

Releases: DataDog/dd-trace-rb

1.9.0

30 Jan 17:27
4a1050c
Compare
Choose a tag to compare
As of ddtrace 1.9.0, CPU Profiling 2.0 is now in opt-in (that is, disabled by default) beta 2. (Click to expand for details) ​You can enable it:
  • Using an environment variable by setting DD_PROFILING_FORCE_ENABLE_NEW=true
  • Or via code by adding to your Datadog.configure block:
Datadog.configure do |c|
  # ... existing configuration ...
  c.profiling.advanced.force_enable_new_profiler = true
end

​What to expect from Ruby CPU Profiling 2.0 beta 2?

  • Finer-grained profiling data due to our sampling engine rewritten in C+Rust. The profiler will be able to run more often and get more information while keeping the same 2% overhead target you're used to, and with a lower impact on latency. Especially when looking at the "Code Hotspots" panel for a distributed trace, expect more and finer grained profiles.
  • Thread id information now includes the operating system thread id for Ruby 3.1+, so you'll be able to correlate your thread information when looking at other system monitoring tools
  • Thread names are now collected and you're able to filter your profiles by these names
  • Experimental support for capturing CPU and Wall-time spent doing Garbage Collection. This is disabled by default as we're still improving the performance of this feature and fixing a few incompatibilities with Ruby Ractors. You can enable it by adding DD_PROFILING_FORCE_ENABLE_GC=true or c.profiling.advanced.force_enable_gc_profiling = true to the instructions seen above.

...with more and faster improvements to come in early 2023!

Give it a try, and we'd love to hear your feedback. Below, you'll find a list of known issues that we're still looking into.

Known issues:

  • Profiling CPU-time overhead is not shown in flamegraphs (unlike with the existing profiler). We will be fixing this soon!

  • Rare incompatibilities with native extensions/libraries.

    Ruby CPU Profiling 2.0 gathers profiling data by sending SIGPROF unix signals to Ruby applications. This is a common approach used by many other profilers, and it may cause system calls performed by native extensions/libraries to be interrupted with an EINTR error code (reference).

    Most native extensions/libraries are unaffected by this issue, but we know of at least one case: when using the mysql2 gem together with versions of libmysqlclient older than 8.0.0 this can lead to failed database requests (reference). The affected libmysqlclient version is known to be present on Ubuntu 18.04, but not 20.04 and later releases.

    We expect these occurrences to be rare, and will be working to both improve the ecosystem as well as to deploy countermeasures in the profiler itself to avoid triggering these issues.

  • Ruby 2.5 and below are missing an API that allows the profiler to detect the currently-active Ruby thread. We have deployed a workaround, but suspect that it may lead to crashes in extremely rare situations. We are still researching a solution for this issue and do not plan on rolling out CPU Profiling 2.0 automatically to Ruby 2.5 and below applications until it is fixed.

  • The disabled-by-default experimental support for capturing CPU and Wall-time spent doing Garbage Collection is incompatible with Ractors due to Ruby upstream bugs (https://bugs.ruby-lang.org/issues/18464 and https://bugs.ruby-lang.org/issues/19112). We plan to work with the Ruby developers to incorporate fixes for these issues.

  • The disabled-by-default experimental support for capturing CPU and Wall-time spent doing Garbage Collection can cause a lot of overhead in Ruby applications with high object allocation rates. We will be fixing this soon!

Added

  • Tracing: Add Stripe instrumentation (#2557)
  • Tracing: Add configurable response codes considered as errors for Net/HTTP, httprb and httpclient (#2501, #2576)(@caramcc)
  • Tracing: Flexible header matching for HTTP propagator (#2504)
  • Tracing: OpenTelemetry Traces support (#2496)
  • Tracing: W3C: Propagate unknown values as-is (#2485)
  • AppSec: Add event kit API (#2512)
  • Profiling: Allow profiler development on arm64 macOS (#2573)
  • Core: Add profiling_enabled state to environment logger output (#2541)
  • Core: Add 'type' to OptionDefinition (#2493)
  • Allow debase-ruby_core_source 3.2.0 to be used (#2526)

Changed

  • Profiling: Upgrade to libdatadog to 1.0.1.1.0 (#2530)
  • Appsec: Update appsec rules 1.4.3 (#2580)
  • Ci: Update CI Visibility metadata extraction (#2586)

Fixed

  • Profiling: Fix wrong libdatadog version being picked during profiler build (#2531)
  • Tracing: Support PG calls with a block (#2522)
  • Ci: Fix error in teamcity env vars (#2562)

Read the full changeset and the release milestone

1.8.0

15 Dec 13:52
ac49c55
Compare
Choose a tag to compare

Happy holidays! This release includes two big items we're pretty excited about and want to call out explicitly:

  • CPU Profiling 2.0 is now in beta! (Click to expand for details)

    As of ddtrace 1.8.0, CPU Profiling 2.0 is now in opt-in (that is, disabled by default) public beta.

    You can enable it:

    • Using an environment variable by setting DD_PROFILING_FORCE_ENABLE_NEW=true
    • Or via code by adding to your Datadog.configure block:
    Datadog.configure do |c|
      # … existing configuration …
    
      c.profiling.advanced.force_enable_new_profiler = true
    end

    What to expect from Ruby CPU Profiling 2.0 beta?

    • Finer-grained profiling data due to our sampling engine rewritten in C+Rust. The profiler will be able to run more often and get more information while keeping the same 2% overhead target you’re used to, and with a lower impact on latency. Especially when looking at the “Code Hotspots” panel for a distributed trace, expect more and finer grained profiles.
    • Thread id information now includes the operating system thread id for Ruby 3.1+, so you’ll be able to correlate your thread information when looking at other system monitoring tools
    • Thread names are now collected and you’ll be able to filter your profiles by these names
    • Experimental support for capturing CPU and Wall-time spent doing Garbage Collection. This is disabled by default as we’re still improving the performance of this feature and fixing a few incompatibilities with Ruby Ractors. You can enable it by adding DD_PROFILING_FORCE_ENABLE_GC=true or c.profiling.advanced.force_enable_gc_profiling = true to the instructions seen above.

    …with more and faster improvements to come in early 2023!

    Give it a try, and we’d love to hear your feedback. Do note that while in beta, we don’t recommend using Ruby CPU Profiling 2.0 in production environments. Below, you’ll find a list of known issues that we’re still looking into.

    Known issues:

    • Profiling CPU-time overhead is not shown in flamegraphs (unlike with the existing profiler). We will be fixing this soon!

    • Rare incompatibilities with native extensions/libraries.

      Ruby CPU Profiling 2.0 gathers profiling data by sending SIGPROF unix signals to Ruby applications. This is a common approach used by many other profilers, and it may cause system calls performed by native extensions/libraries to be interrupted with an EINTR error code (reference).

      Most native extensions/libraries are unaffected by this issue, but we know of at least one case: when using the mysql2 gem together with versions of libmysqlclient older than 8.0.0 this can lead to failed database requests (reference). The affected libmysqlclient version is known to be present on Ubuntu 18.04, but not 20.04 and later releases.

      We expect these occurrences to be rare, and will be working to both improve the ecosystem as well as to deploy countermeasures in the profiler itself to avoid triggering these issues.

    • Ruby 2.5 and below are missing an API that allows the profiler to detect the currently-active Ruby thread. We have deployed a workaround, but suspect that it may lead to crashes in extremely rare situations. We are still researching a solution for this issue and do not plan on rolling out CPU Profiling 2.0 automatically to Ruby 2.5 and below applications until it is fixed.

    • The disabled-by-default experimental support for capturing CPU and Wall-time spent doing Garbage Collection is incompatible with Ractors due to Ruby upstream bugs (https://bugs.ruby-lang.org/issues/18464 and https://bugs.ruby-lang.org/issues/19112). We plan to work with the Ruby developers to incorporate fixes for these issues.

    • The disabled-by-default experimental support for capturing CPU and Wall-time spent doing Garbage Collection can cause a lot of overhead in Ruby applications with high object allocation rates. We will be fixing this soon!

  • redis 5 instrumentation upgrade notes

redis 5 instrumentation upgrade notes

dd-trace-rb officially supports redis 5 instrumentation. When upgrading redis gem to 5.x and with configuration per instance, change your code by passing {custom: datadog: { … }} tags during redis instantiation.

Before redis 5

customer_cache = Redis.new
invoice_cache = Redis.new

Datadog.configure_onto(customer_cache, service_name: 'customer-cache')
Datadog.configure_onto(invoice_cache, service_name: 'invoice-cache')

customer_cache.get(...)
invoice_cache.get(...)

After upgrading to redis 5.x

customer_cache = Redis.new(custom: { datadog: { service_name: 'custom-cache' } })
invoice_cache = Redis.new(custom: { datadog: { service_name: 'invoice-cache' } })

customer_cache.get(...)
invoice_cache.get(...)

More improvements

Added

  • Core: Profiling: [PROF-6559] Mark Ruby CPU Profiling 2.0 as being in beta (#2489)
  • Tracing: Attempt to parse future version of TraceContext (#2473)
  • Tracing: Add DD_TRACE_PROPAGATION_STYLE option (#2466)
  • Integrations: Tracing: SQL comment propagation full mode with traceparent (#2464)
  • Integrations: Tracing: Wire W3C propagator to HTTP & gRPC propagation (#2458)
  • Integrations: Tracing: Auto-instrumentation with service_name from environmental variable (#2455)
  • Core: Integrations: Tracing: Deprecation notice for B3 propagation configuration (#2454)
  • Tracing: Add W3C Trace Context propagator (#2451)
  • Integrations: Tracing: Redis 5 Instrumentation (#2428)

Changed

  • Tracing: Changes error.msg to error.message for UNC (#2469)
  • Tracing: Semicolons not allowed in 'origin' (#2461)
  • Core: Dev/refactor: Tracing: Dev/internal: Move Utils#next_id and constants to Tracing::Utils (#2463)
  • Core: Dev/refactor: Tracing: Dev/internal: Move Tracing config settings from Core to Tracing (#2459)
  • Core: Dev/refactor: Tracing: Dev/internal: Move Tracing diagnostic code from Core to Tracing (#2453)

Fixed

  • Integrations: Tracing: Improve redis integration patching (#2470)
  • Tracing: Extra testing from W3C spec (#2460)

Read the full changeset and the release milestone.

1.7.0

30 Nov 09:12
970c87a
Compare
Choose a tag to compare

Added

  • Integrations: Support que 2 (#2382) (@danhodge)
  • Tracing: Unified tagging span.kind as server and client (#2365)
  • Tracing: Adds span.kind tag for kafka, sidekiq, racecar, que, shoryuken, sneakers, and resque (#2420, #2419, #2413, #2394)
  • Tracing: Adds span.kind with values producer and consumer for delayed_job (#2393)
  • Tracing: Adds span.kind as client for redis (#2392)
  • Appsec: Pass HTTP client IP to WAF (#2316)
  • Unified tagging process_id (#2276)

Changed

  • Allow debase-ruby_core_source 0.10.18 to be used (#2435)
  • Update AppSec ruleset to v1.4.2 (#2390)
  • Refactored clearing of profile data after Ruby app forks (#2362, #2367)
  • Tracing: Move distributed propagation to Contrib (#2352)

Fixed

  • Fix ddtrace installation issue when users have CI=true (#2378)

Read the full changeset and the release milestone.

1.6.1

16 Nov 21:14
79738b1
Compare
Choose a tag to compare

Changed

  • Limit redis version support to less than 5

Fixed

  • [redis]: Fix frozen input for Redis.new(...)

Read the full changeset and the release milestone.

1.6.0

15 Nov 18:48
4114496
Compare
Choose a tag to compare

Added

  • Trace level tags propagation in distributed tracing (#2260)
  • [hanami]: Hanami 1.x instrumentation (#2230)
  • [pg, mysql2]: option comment_propagation for SQL comment propagation, default is disabled (#2339)(#2324)

Changed

  • [rack, sinatra]: Squash nested spans and improve patching mechanism.
    No need to register Datadog::Tracing::Contrib::Sinatra::Tracer(#2217)
  • [rails, rack]: Fix Non-GET request method with rails exception controller (#2317)
  • Upgrade to libdatadog 0.9.0.1.0 (#2302)
  • Remove legacy profiling transport (#2062)

Fixed

  • [redis]: Fix redis instance configuration, not on client (#2363)
# Change your code from
Datadog.configure_onto(redis.client, service_name: '...')
# to
Datadog.configure_onto(redis, service_name: '...')
  • Allow DD_TAGS values to have the colon character (#2292)
  • Ensure that TraceSegment can be reported correctly when they are dropped (#2335)
  • Docs: Fixes upgrade guide on configure_onto (#2307)
  • Fix environment logger with IO transport (#2313)

Read the full changeset and the release milestone

1.5.2

27 Oct 16:06
15125bc
Compare
Choose a tag to compare

Deprecation notice

  • DD_TRACE_CLIENT_IP_HEADER_DISABLED was changed to DD_TRACE_CLIENT_IP_ENABLED. Although the former still works we encourage usage of the latter instead.

Changed

  • http.client_ip tag collection is made opt-in for APM. Note that http.client_ip is always collected when ASM is enabled as part of the security service provided (#2321, #2331)

Fixed

Read the full changeset and the release milestone.

1.5.1

19 Oct 20:26
95d7a5c
Compare
Choose a tag to compare

Changed

  • Update libddwaf to 1.5.1 (#2306)
  • Improve libddwaf extension memory management (#2306)

Fixed

  • Fix URI::InvalidURIError (#2310, #2318) (@yujideveloper)
  • Handle URLs with invalid characters (#2311, #2319)
  • Fix missing appsec.event tag (#2306)
  • Fix missing Rack and Rails request body parsing for AppSec analysis (#2306)
  • Fix unneeded AppSec call in a Rack context when AppSec is disabled (#2306)
  • Fix spurious AppSec instrumentation (#2306)

Read the full changeset and the release [milestone](https://github.com/DataDog/dd-trace-rb/milestone/112?closed=1

1.5.0

29 Sep 21:03
9d916d1
Compare
Choose a tag to compare

Deprecation notice

  • c.tracing.instrument :rack, { quantize: { base: ... } } will change its default from :exclude to :show in a future version. Voluntarily moving to :show is recommended.
  • c.tracing.instrument :rack, { quantize: { query: { show: ... } } will change its default to :all in a future version, together with quantize.query.obfuscate changing to :internal. Voluntarily moving to these future values is recommended.

See the Rack integration documentation for more details.

Added

  • Feature: Single Span Sampling (#2128)
  • Add query string automatic redaction (#2283)
  • Use full URL in http.url tag (#2265)
  • Add http.useragent tag (#2252)
  • Add http.client_ip tag for Rack-based frameworks (#2248)
  • Ci-app: CI: Fetch committer and author in Bitrise (#2258)

Changed

  • Bump allowed version of debase-ruby_core_source to include v0.10.17 (#2267)

Fixed

  • Bug: Fix service_nam typo to service_name (#2296)
  • Bug: Check AppSec Rails for railties instead of rails meta gem (#2293) (@seuros)
  • Ci-app: Correctly extract commit message from AppVeyor (#2257)

Read the full changeset and the release milestone.

1.4.2

27 Sep 21:25
83a6408
Compare
Choose a tag to compare

Fixed

OpenTracing context propagation (#2191, #2289)

Read the full changeset and the release milestone.

1.4.1

15 Sep 23:44
f319975
Compare
Choose a tag to compare

Fixed

  • Missing distributed traces when trace is dropped by priority sampling (#2101, #2279)
  • Profiling support when Ruby is compiled without a shared library (#2250)

Read the full changeset and the release milestone.