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

contrib/database/sql: use tracer-level tags on contrib's statsd.Client #2635

Merged
merged 8 commits into from
Apr 5, 2024

Conversation

mtoffl01
Copy link
Contributor

@mtoffl01 mtoffl01 commented Mar 27, 2024

What does this PR do?

The "DB Stats" metrics reported by the database/sql integration now accurately report hostname, env, lang and lang_version tags that were previously private to the tracer.
The tracer now publishes these tags so that integrations that submit statsd payloads (currently only database/sql) can use them.
The metrics also report the service tag, which is unique to the contrib. The service tag should not be shared from tracer to contribs, as contribs determine their own service name.

Motivation

Tags such as service and env are critical for correlating data across Datadog products (e.g, Metrics and APM), so it was important that these tags report accurately on our metrics.
Ref: https://docs.datadoghq.com/getting_started/tagging/unified_service_tagging/

2024-03-27_15-58-42 2024-03-27_15-59-03

Reviewer's Checklist

  • Changed code has unit tests for its functionality at or near 100% coverage.
  • System-Tests covering this feature have been added and enabled with the va.b.c-dev version tag.
  • There is a benchmark for any new code, or changes to existing code.
  • If this interacts with the agent in a new way, a system test has been added.
  • Add an appropriate team label so this PR gets put in the right place for the release notes.
  • Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild.

For Datadog employees:

  • If this PR touches code that handles credentials of any kind, such as Datadog API keys, I've requested a review from @DataDog/security-design-and-guidance.
  • This PR doesn't touch any of that.

Unsure? Have a question? Request a review!

@mtoffl01 mtoffl01 requested review from a team as code owners March 27, 2024 21:02
@github-actions github-actions bot added the apm:ecosystem contrib/* related feature requests or bugs label Mar 27, 2024
@pr-commenter
Copy link

pr-commenter bot commented Mar 27, 2024

Benchmarks

Benchmark execution time: 2024-04-03 15:10:14

Comparing candidate commit c840589 in PR branch mtoff/AIT-10026 with baseline commit 055b896 in branch main.

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

scenario:BenchmarkPartialFlushing/Enabled-24

  • 🟩 execution_time [-11.879ms; -9.253ms] or [-4.171%; -3.249%]

@mtoffl01 mtoffl01 changed the title contrib/database/sql: use tags on statsd.Client only known to tracer contrib/database/sql: use tracer-level tags on contrib's statsd.Client Mar 28, 2024
@darccio
Copy link
Member

darccio commented Apr 4, 2024

@mtoffl01 Should we merge this?

@mtoffl01 mtoffl01 enabled auto-merge (squash) April 4, 2024 15:00
@mtoffl01 mtoffl01 merged commit df02f90 into main Apr 5, 2024
152 of 157 checks passed
@mtoffl01 mtoffl01 deleted the mtoff/AIT-10026 branch April 5, 2024 01:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apm:ecosystem contrib/* related feature requests or bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants