Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove default value from peer.service tag #3846

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

marcotc
Copy link
Member

@marcotc marcotc commented Aug 14, 2024

Today, the default value of the span tag peer.service does not provide the correct semantics to populated the new Inferred Service dependency experience.

The peer.service tag should only be used as an explicit user override, which is supported today by APM Ruby.

This PR removes the default value of peer.service, while keeping any explicitly values set by configuration (e.g. c.tracing.instrument :pg, peer_service: 'mydb').

If you need to keep the default values of peer.service, you can set the environment variable DD_TRACE_PEER_SERVICE_DEFAULTS_ENABLED=true to restore the behavior to before this change.

@marcotc marcotc self-assigned this Aug 14, 2024
@marcotc marcotc requested review from a team as code owners August 14, 2024 22:29
@github-actions github-actions bot added core Involves Datadog core libraries integrations Involves tracing integrations tracing labels Aug 14, 2024
@pr-commenter
Copy link

pr-commenter bot commented Aug 14, 2024

Benchmarks

Benchmark execution time: 2024-08-15 20:54:26

Comparing candidate commit f449211 in PR branch DD_TRACE_PEER_SERVICE_DEFAULTS_ENABLED with baseline commit 7c67ce3 in branch master.

Found 4 performance improvements and 0 performance regressions! Performance is the same for 19 metrics, 2 unstable metrics.

scenario:profiler - Major GC runs (profiling disabled)

  • 🟩 throughput [+3.249op/s; +3.669op/s] or [+2.783%; +3.143%]

scenario:profiler - Major GC runs (profiling enabled)

  • 🟩 throughput [+3.124op/s; +3.530op/s] or [+2.830%; +3.197%]

scenario:profiler - profiler gc

  • 🟩 throughput [+8550.667op/s; +9104.791op/s] or [+2.357%; +2.510%]

scenario:tracing - trace.to_digest

  • 🟩 throughput [+4410.153op/s; +5114.196op/s] or [+2.734%; +3.170%]

@marcotc marcotc force-pushed the DD_TRACE_PEER_SERVICE_DEFAULTS_ENABLED branch from 1209861 to ccffd07 Compare August 14, 2024 22:43
@codecov-commenter
Copy link

codecov-commenter commented Aug 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.84%. Comparing base (7c67ce3) to head (f449211).
Report is 25 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3846      +/-   ##
==========================================
- Coverage   97.84%   97.84%   -0.01%     
==========================================
  Files        1264     1264              
  Lines       75726    75745      +19     
  Branches     3729     3730       +1     
==========================================
+ Hits        74094    74109      +15     
- Misses       1632     1636       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

sig/datadog/tracing/configuration/ext.rbs Show resolved Hide resolved
@@ -123,6 +123,17 @@ def self.included(base)
o.default({})
end

# Enables population the `peer.service` tag.
# When disabled, other peer service related configurations have no effect.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wanted to ask for this (as I'm not sure), but isn't it peer.service also supposed to be calculated for v1 schema (is that a thing in Ruby I don't actually see it in the repo?).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand the question, maybe I don't know exactly what you mean by v1 schema.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For example, in .NET: https://github.com/DataDog/dd-trace-dotnet/blob/45a66abc870d1d45ce0778909162203e55dcfa2a/tracer/src/Datadog.Trace/Configuration/ConfigurationKeys.cs#L428

Maybe it isn't a thing for Ruby?
https://github.com/search?q=org%3ADataDog%20DD_TRACE_SPAN_ATTRIBUTE_SCHEMA&type=code

Ruby only has one use of it and it appears to be a fake usage to get system-tests working, so maybe this is just something that wasn't needed for Ruby?

# setting DD_TRACE_SPAN_ATTRIBUTE_SCHEMA as the APM Test Agent relies on this ENV to run service naming assertions

config = Datadog.configuration.tracing.contrib

# If `peer_service_defaults` is disabled, we only read peer service from an explicitly set `peer.service` tag
sources = Datadog::Tracing::Contrib::SpanAttributeSchema::REFLEXIVE_SOURCES unless config.peer_service_defaults
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is sources set from two sources and then overwritten with one of the source?

@ivoanjo
Copy link
Member

ivoanjo commented Dec 9, 2024

Hey folks, is this still a thing we want to push forward?

@tatsuo48
Copy link

Hi. I'm using Inferred Service dependency experience in Ruby
So I hope to merge&release this PR.
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Involves Datadog core libraries integrations Involves tracing integrations tracing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants