Skip to content

Conversation

@jbertran
Copy link
Contributor

@jbertran jbertran commented May 22, 2023

What does this PR do?

Add peer service API for all spans of outgoing types, i.e. all client and producer spans.

Motivation

Introducing tags to provide the data necessary for a better service map with less fake services.

  • peer.service: the new source of truth for the service map, computed from precursor tags
  • _dd.peer.service.source: the name of the tag use to get the value of peer service

These tags are added:

  • in service naming version v0 if the environment variable DD_TRACE_SPAN_PEER_SERVICE is set to a truthy value
  • in all other service naming versions by default

Computing these uses the existing plugin hierarchy, with an optional peerServicePrecursors getter on classes which have more precursors than the default OTel/DDog out.host/net.peer.host tag.

This PR enables the computation of peer service for all ClientPlugin children, but not all of them have tests for peer service. This is because they (mostly databases) do not all have the correct precursors yet, or precursor sources need to be added - currently, only common tags are present, although the mechanism to add more tags is available.

Plugin Checklist

  • Unit tests.

Additional Notes

@github-actions
Copy link

github-actions bot commented May 22, 2023

Overall package size

Self size: 4.36 MB
Deduped: 60.72 MB
No deduping: 60.76 MB

Dependency sizes

name version self size total size
@datadog/pprof 2.2.1 14.24 MB 15.12 MB
@datadog/native-iast-taint-tracking 1.5.0 14.86 MB 14.86 MB
@datadog/native-appsec 3.2.0 13.38 MB 13.39 MB
protobufjs 7.1.2 2.76 MB 6.55 MB
@datadog/native-iast-rewriter 2.0.1 2.09 MB 2.1 MB
@opentelemetry/core 1.3.1 784.66 kB 1.37 MB
@datadog/native-metrics 2.0.0 898.77 kB 1.3 MB
@opentelemetry/api 1.4.1 780.32 kB 780.32 kB
opentracing 0.14.7 194.81 kB 194.81 kB
semver 7.3.8 88.2 kB 118.6 kB
@datadog/sketches-js 2.1.0 109.9 kB 109.9 kB
lodash.sortby 4.7.0 75.76 kB 75.76 kB
lru-cache 7.14.0 74.95 kB 74.95 kB
ipaddr.js 2.0.1 59.52 kB 59.52 kB
ignore 5.2.0 48.87 kB 48.87 kB
import-in-the-middle 1.3.5 34.34 kB 38.81 kB
istanbul-lib-coverage 3.2.0 29.34 kB 29.34 kB
retry 0.10.1 27.44 kB 27.44 kB
lodash.uniq 4.5.0 25.01 kB 25.01 kB
limiter 1.1.5 23.17 kB 23.17 kB
lodash.kebabcase 4.1.1 17.75 kB 17.75 kB
lodash.pick 4.4.0 16.33 kB 16.33 kB
node-abort-controller 3.0.1 14.33 kB 14.33 kB
crypto-randomuuid 1.0.0 11.18 kB 11.18 kB
diagnostics_channel 1.1.0 7.07 kB 7.07 kB
path-to-regexp 0.1.7 6.78 kB 6.78 kB
koalas 1.0.2 6.47 kB 6.47 kB
methods 1.1.2 5.29 kB 5.29 kB
module-details-from-path 1.0.3 4.47 kB 4.47 kB

🤖 This report was automatically generated by heaviest-objects-in-the-universe

@jbertran jbertran force-pushed the jbertran/peer-service branch from 5b86ab7 to 9bb9c32 Compare May 22, 2023 15:22
@codecov
Copy link

codecov bot commented May 22, 2023

Codecov Report

Merging #3177 (e901fdb) into master (d2b6d48) will decrease coverage by 0.09%.
The diff coverage is 57.14%.

@@            Coverage Diff             @@
##           master    #3177      +/-   ##
==========================================
- Coverage   86.02%   85.94%   -0.09%     
==========================================
  Files         194      194              
  Lines        7514     7534      +20     
  Branches       33       33              
==========================================
+ Hits         6464     6475      +11     
- Misses       1050     1059       +9     
Impacted Files Coverage Δ
packages/dd-trace/src/constants.js 100.00% <ø> (ø)
packages/dd-trace/src/plugins/outbound.js 48.14% <50.00%> (-1.86%) ⬇️
packages/dd-trace/src/config.js 99.04% <100.00%> (+<0.01%) ⬆️
packages/dd-trace/src/opentracing/tracer.js 98.50% <100.00%> (+0.02%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@pr-commenter
Copy link

pr-commenter bot commented May 22, 2023

Benchmarks

Comparing candidate commit e901fdb in PR branch jbertran/peer-service with baseline commit d2b6d48 in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 389 metrics, 23 unstable metrics.

@jbertran jbertran force-pushed the jbertran/peer-service branch 4 times, most recently from 70c8bc2 to e3603e9 Compare June 19, 2023 11:33
@jbertran jbertran force-pushed the jbertran/peer-service branch from e3603e9 to e901fdb Compare June 19, 2023 11:36
@jbertran jbertran marked this pull request as ready for review June 19, 2023 13:53
@jbertran jbertran requested a review from a team as a code owner June 19, 2023 13:53
@jbertran jbertran merged commit 4e46109 into master Jun 23, 2023
tlhunter pushed a commit that referenced this pull request Jun 29, 2023
* introduce peer service computation for outbound edges:
    * add DD_TRACE_SPAN_PEER_SERVICE environment variable
    * add peer service computation logic
    * TODO: add tests for config, outbound, tracer (?)
* provide a helper for testing peer service computation
* defer plugin `finish` to TracingPlugin in children
tlhunter pushed a commit that referenced this pull request Jun 29, 2023
* introduce peer service computation for outbound edges:
    * add DD_TRACE_SPAN_PEER_SERVICE environment variable
    * add peer service computation logic
    * TODO: add tests for config, outbound, tracer (?)
* provide a helper for testing peer service computation
* defer plugin `finish` to TracingPlugin in children
tlhunter pushed a commit that referenced this pull request Jun 29, 2023
* introduce peer service computation for outbound edges:
    * add DD_TRACE_SPAN_PEER_SERVICE environment variable
    * add peer service computation logic
    * TODO: add tests for config, outbound, tracer (?)
* provide a helper for testing peer service computation
* defer plugin `finish` to TracingPlugin in children
tlhunter pushed a commit that referenced this pull request Jun 29, 2023
* introduce peer service computation for outbound edges:
    * add DD_TRACE_SPAN_PEER_SERVICE environment variable
    * add peer service computation logic
    * TODO: add tests for config, outbound, tracer (?)
* provide a helper for testing peer service computation
* defer plugin `finish` to TracingPlugin in children
tlhunter pushed a commit that referenced this pull request Jun 29, 2023
* introduce peer service computation for outbound edges:
    * add DD_TRACE_SPAN_PEER_SERVICE environment variable
    * add peer service computation logic
    * TODO: add tests for config, outbound, tracer (?)
* provide a helper for testing peer service computation
* defer plugin `finish` to TracingPlugin in children
@tlhunter tlhunter mentioned this pull request Jun 29, 2023
This was referenced Jun 29, 2023
tlhunter pushed a commit that referenced this pull request Jun 30, 2023
* introduce peer service computation for outbound edges:
    * add DD_TRACE_SPAN_PEER_SERVICE environment variable
    * add peer service computation logic
    * TODO: add tests for config, outbound, tracer (?)
* provide a helper for testing peer service computation
* defer plugin `finish` to TracingPlugin in children
tlhunter pushed a commit that referenced this pull request Jun 30, 2023
* introduce peer service computation for outbound edges:
    * add DD_TRACE_SPAN_PEER_SERVICE environment variable
    * add peer service computation logic
    * TODO: add tests for config, outbound, tracer (?)
* provide a helper for testing peer service computation
* defer plugin `finish` to TracingPlugin in children
tlhunter pushed a commit that referenced this pull request Jun 30, 2023
* introduce peer service computation for outbound edges:
    * add DD_TRACE_SPAN_PEER_SERVICE environment variable
    * add peer service computation logic
    * TODO: add tests for config, outbound, tracer (?)
* provide a helper for testing peer service computation
* defer plugin `finish` to TracingPlugin in children
tlhunter pushed a commit that referenced this pull request Jun 30, 2023
* introduce peer service computation for outbound edges:
    * add DD_TRACE_SPAN_PEER_SERVICE environment variable
    * add peer service computation logic
    * TODO: add tests for config, outbound, tracer (?)
* provide a helper for testing peer service computation
* defer plugin `finish` to TracingPlugin in children
tlhunter pushed a commit that referenced this pull request Jun 30, 2023
* introduce peer service computation for outbound edges:
    * add DD_TRACE_SPAN_PEER_SERVICE environment variable
    * add peer service computation logic
    * TODO: add tests for config, outbound, tracer (?)
* provide a helper for testing peer service computation
* defer plugin `finish` to TracingPlugin in children
tlhunter pushed a commit that referenced this pull request Jun 30, 2023
* introduce peer service computation for outbound edges:
    * add DD_TRACE_SPAN_PEER_SERVICE environment variable
    * add peer service computation logic
    * TODO: add tests for config, outbound, tracer (?)
* provide a helper for testing peer service computation
* defer plugin `finish` to TracingPlugin in children
@tlhunter tlhunter deleted the jbertran/peer-service branch January 19, 2024 22:20
@crysmags crysmags mentioned this pull request Jun 7, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants