dd-trace-rb icon indicating copy to clipboard operation
dd-trace-rb copied to clipboard

Datadog::Tracing.correlation without trace information

Open c2ofh opened this issue 1 year ago • 1 comments

Current behaviour Datadog::Tracing.correlation output does not include trace_information

Expected behaviour Information about trace_name, trace_resource, trace_service

Steps to reproduce Use ddtrace gem. There the information is included.
Now we switched to datadog gem as it's needed for using profiling.

How does datadog help you? To extend our log by helpful information to support customers

Environment

  • datadog version: 2.1.0
  • Configuration block (Datadog.configure ...):
  require 'action_pack'
  require 'active_support'
  require 'active_record'
  require 'active_job'
  require 'datadog'
  require 'http'
  require 'rake'

  Datadog.configure do |c|
    c.env = 'prod'
    c.service = 'backend'
    c.version = '12.5.0'
    c.runtime_metrics.enabled = true

    c.tracing.report_hostname = true

    c.tracing.instrument :action_mailer
    c.tracing.instrument :action_pack
    c.tracing.instrument :active_support
    c.tracing.instrument :action_view
    c.tracing.instrument :action_cable
    c.tracing.instrument :active_job

    c.tracing.instrument :active_record, describes: {
      adapter:  'postgresql',
      host:     '127.0.0.1',
      port:     '5447',
      database: 'backend_p',
      username: 'backend_p'
    }, service_name: 'postgresql'

    c.tracing.instrument :httprb do |httprb|
      httprb.service_name = 'RestAPI'
      httprb.split_by_domain = false
    end

    c.tracing.instrument :rails
    c.tracing.instrument :rake
    c.tracing.instrument :sidekiq

    c.profiling.enabled = true

    c.diagnostics.startup_logs.enabled = false
  end
  • Ruby version: 2.7.3
  • Operating system: Ubuntu
  • Relevant library versions: Rails 5.2.8

c2ofh avatar Jul 09 '24 23:07 c2ofh

👋 @c2ofh , Thanks for reaching out. There are fields being removed from Correlation::Identifier in 2.x , https://github.com/DataDog/dd-trace-rb/blob/master/docs/UpgradeGuide2.md#log-correlation .

Information about trace_name, trace_resource, trace_service

Those fields were not part of our public API, hence they are not tested, documented and subject to changes. My understanding is that Correlation::Identifier#service is still available and should return the same result for trace_service (trace_name, trace_resource are removed)

Could you provide an example about how you add custom information into your logs? What does the log looks like before & after.

TonyCTHsu avatar Jul 10 '24 08:07 TonyCTHsu

We haven't heard back on this one for a while, so I'm going to go ahead and close it. Please do open a new ticket if there's anything we can help with :)

ivoanjo avatar Dec 09 '24 16:12 ivoanjo