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

Allow passing web_service_name option to Rack through Rails tracer

Open Surgo opened this issue 1 year ago • 6 comments

Allow passing web_service_name like #2082

Surgo avatar Mar 24 '23 08:03 Surgo

bump! Would love to see this land.

esalter avatar Sep 26 '23 20:09 esalter

Just voicing support - my team would love to see this land too :)

tylerwillingham avatar Oct 04 '23 21:10 tylerwillingham

@Surgo is there an issue with this being done at the Rack level, c.tracing.instrument :rack, web_service_name: ...?

marcotc avatar Oct 24 '23 16:10 marcotc

@marcotc @Surgo speaking from another team at another company that was also surprised to learn that we couldn't pass web_service_name to the configuration for the rails instrument (like we do with request_queuing): we were similarly surprised when this option didn't pass through.

We spent a decent bit of time debugging and reading source code to realize "request_queuing" is getting special treatment (and it's pretty nice) but its sibling argument of "web_service_name" wasn't.

It feels like a precedent has been set to allow these args to pass through and it makes the configuration a little cleaner

tylerwillingham avatar Nov 08 '23 15:11 tylerwillingham

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.22%. Comparing base (22c0370) to head (8d51f83). Report is 1439 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2716      +/-   ##
==========================================
- Coverage   98.23%   98.22%   -0.01%     
==========================================
  Files        1253     1253              
  Lines       72690    72693       +3     
  Branches     3415     3415              
==========================================
- Hits        71405    71404       -1     
- Misses       1285     1289       +4     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Dec 08 '23 04:12 codecov-commenter

is there an issue with this being done at the Rack level, c.tracing.instrument :rack, web_service_name: ...?

I'm finding this isn't working for us (gem version 1.23.2). Any ideas? Otherwise, it would be nice for this PR to be merged.

Edit: The workaround did work in version 2.1.0.

Datadog.configure do |config|
    service_name = ENV.fetch("HEROKU_APP_NAME")

    config.tracing.instrument :rails, service_name: service_name, request_queuing: true
...
    config.tracing.instrument :rack, service_name: "#{service_name}-rack", web_service_name: "#{service_name}-puma"
end

langsharpe avatar Jun 27 '24 00:06 langsharpe