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

Auto-instrumentation with service_name from environmental variable #2455

Merged
merged 19 commits into from
Dec 7, 2022

Conversation

TonyCTHsu
Copy link
Contributor

@TonyCTHsu TonyCTHsu commented Dec 2, 2022

What does this PR do?

Allow integration service name being configured by environment variable

Integration Environment variable
aws DD_TRACE_AWS_SERVICE_NAME
dalli DD_TRACE_DALLI_SERVICE_NAME
elasticsearch DD_TRACE_ELASTICSEARCH_SERVICE_NAME
ethon DD_TRACE_ETHON_SERVICE_NAME
excon DD_TRACE_EXCON_SERVICE_NAME
faraday DD_TRACE_FARADAY_SERVICE_NAME
grpc DD_TRACE_GRPC_SERVICE_NAME
http DD_TRACE_NET_HTTP_SERVICE_NAME
httpclient DD_TRACE_HTTPCLIENT_SERVICE_NAME
httprb DD_TRACE_HTTPRB_SERVICE_NAME
mongodb DD_TRACE_MONGO_SERVICE_NAME
mysql2 DD_TRACE_MYSQL2_SERVICE_NAME
pg DD_TRACE_PG_SERVICE_NAME
presto DD_TRACE_PRESTO_SERVICE_NAME
redis DD_TRACE_REDIS_SERVICE_NAME
rest-client DD_TRACE_REST_CLIENT_SERVICE_NAME

@github-actions github-actions bot added integrations Involves tracing integrations tracing labels Dec 2, 2022
@TonyCTHsu TonyCTHsu force-pushed the tonycthsu/auto-instrument-with-environment-variable branch from b620137 to 26637c8 Compare December 6, 2022 11:14
@TonyCTHsu TonyCTHsu force-pushed the tonycthsu/auto-instrument-with-environment-variable branch from 26637c8 to 3d4593f Compare December 6, 2022 14:26
@codecov-commenter
Copy link

Codecov Report

Merging #2455 (3d4593f) into master (91cc56a) will increase coverage by 0.01%.
The diff coverage is 99.06%.

@@            Coverage Diff             @@
##           master    #2455      +/-   ##
==========================================
+ Coverage   98.01%   98.03%   +0.01%     
==========================================
  Files        1105     1109       +4     
  Lines       59276    59951     +675     
==========================================
+ Hits        58100    58771     +671     
- Misses       1176     1180       +4     
Impacted Files Coverage Δ
...dog/tracing/contrib/grpc/configuration/settings.rb 96.00% <80.00%> (-4.00%) ⬇️
...g/tracing/contrib/mysql2/configuration/settings.rb 96.29% <80.00%> (-3.71%) ⬇️
...tadog/tracing/contrib/pg/configuration/settings.rb 96.29% <80.00%> (-3.71%) ⬇️
spec/support/core_helpers.rb 85.00% <85.00%> (ø)
lib/datadog/tracing/distributed/trace_context.rb 99.32% <99.32%> (ø)
lib/datadog/core.rb 93.33% <100.00%> (+5.83%) ⬆️
lib/datadog/core/configuration/settings.rb 97.66% <100.00%> (+0.13%) ⬆️
lib/datadog/core/environment/variable_helpers.rb 100.00% <100.00%> (ø)
lib/datadog/tracing/configuration/ext.rb 100.00% <100.00%> (ø)
...adog/tracing/contrib/aws/configuration/settings.rb 100.00% <100.00%> (ø)
... and 59 more

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

@TonyCTHsu TonyCTHsu marked this pull request as ready for review December 6, 2022 16:11
@TonyCTHsu TonyCTHsu requested a review from a team December 6, 2022 16:11
@TonyCTHsu TonyCTHsu self-assigned this Dec 6, 2022
@delner
Copy link
Contributor

delner commented Dec 6, 2022

Suggestion: rename DD_TRACE_HTTP_SERVICE_NAME to DD_TRACE_NET_HTTP_SERVICE_NAME.

My thought is HTTP is too generic and might get confused with other configuration.

@@ -43,6 +44,7 @@

it_behaves_like 'measured span for integration'
it_behaves_like 'a peer service span'
it_behaves_like 'environment service name', 'DD_TRACE_AWS_SERVICE_NAME'
Copy link
Member

Choose a reason for hiding this comment

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

Good job on creating a shared example! Super clean! 🧹

@TonyCTHsu TonyCTHsu merged commit 7176d38 into master Dec 7, 2022
@TonyCTHsu TonyCTHsu deleted the tonycthsu/auto-instrument-with-environment-variable branch December 7, 2022 11:37
@github-actions github-actions bot added this to the 1.8.0 milestone Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrations Involves tracing integrations tracing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants