Skip to content

feat(dbm): add peer entity dbm comment attributes#8286

Merged
rarguelloF merged 10 commits into
mainfrom
rarguelloF/AIT-9563/dbm-peer-entity-tags
Feb 26, 2024
Merged

feat(dbm): add peer entity dbm comment attributes#8286
rarguelloF merged 10 commits into
mainfrom
rarguelloF/AIT-9563/dbm-peer-entity-tags

Conversation

@rarguelloF

@rarguelloF rarguelloF commented Feb 5, 2024

Copy link
Copy Markdown
Contributor

Adds the following 2 new attributes to the DBM injected query comments:

  • ddh: represents the peer hostname of the request.
  • dddb: represents the db instance.

These tags are necessary so the APM<->DBM connection still works when using the peer.service powered features.

Integrations affected:

  • psycopg
  • psycopg2

The following integrations support DBM comment injection but do not set tags with information about the db name or peer hostname, so the comment attributes won't be added:

  • dbapi
  • dbapi_async

Checklist

  • Change(s) are motivated and described in the PR description
  • Testing strategy is described if automated tests are not included in the PR
  • Risks are described (performance impact, potential for breakage, maintainability)
  • Change is maintainable (easy to change, telemetry, documentation)
  • Library release note guidelines are followed or label changelog/no-changelog is set
  • Documentation is included (in-code, generated user docs, public corp docs)
  • Backport labels are set (if applicable)
  • If this PR changes the public interface, I've notified @DataDog/apm-tees.
  • If change touches code that signs or publishes builds or packages, or handles credentials of any kind, I've requested a review from @DataDog/security-design-and-guidance.

Reviewer Checklist

  • Title is accurate
  • All changes are related to the pull request's stated goal
  • Description motivates each change
  • Avoids breaking API changes
  • Testing strategy adequately addresses listed risks
  • Change is maintainable (easy to change, telemetry, documentation)
  • Release note makes sense to a user of the library
  • Author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment
  • Backport labels are set in a manner that is consistent with the release branch maintenance policy

@rarguelloF
rarguelloF force-pushed the rarguelloF/AIT-9563/dbm-peer-entity-tags branch from 62f8dd2 to f21d056 Compare February 5, 2024 11:10
@rarguelloF rarguelloF changed the title feat(dbm): add peer entity dbm tags feat(dbm): add peer entity dbm comment attributes Feb 5, 2024
@rarguelloF
rarguelloF requested a review from tabgok February 5, 2024 11:44
Comment thread ddtrace/propagation/_database_monitoring.py Outdated
Comment thread ddtrace/propagation/_database_monitoring.py Outdated
Comment thread tests/internal/test_database_monitoring.py
@pr-commenter

pr-commenter Bot commented Feb 5, 2024

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2024-02-26 13:17:11

Comparing candidate commit e9e86ec in PR branch rarguelloF/AIT-9563/dbm-peer-entity-tags with baseline commit bb428ca in branch main.

Found 3 performance improvements and 3 performance regressions! Performance is the same for 197 metrics, 9 unstable metrics.

scenario:flasksimple-appsec-get

  • 🟥 execution_time [+226.148µs; +273.326µs] or [+3.585%; +4.333%]

scenario:flasksimple-appsec-telemetry

  • 🟥 execution_time [+212.775µs; +260.503µs] or [+3.370%; +4.126%]

scenario:otelspan-start

  • 🟩 max_rss_usage [-4.368MB; -4.247MB] or [-8.740%; -8.498%]

scenario:samplingrules-average_match

  • 🟩 max_rss_usage [-1.071MB; -0.953MB] or [-3.570%; -3.178%]

scenario:samplingrules-high_match

  • 🟩 max_rss_usage [-1.101MB; -0.975MB] or [-3.672%; -3.251%]

scenario:span-add-metrics

  • 🟥 max_rss_usage [+25.765MB; +25.876MB] or [+65.827%; +66.108%]

Comment thread ddtrace/propagation/_database_monitoring.py
@datadog-dd-trace-py-rkomorn

datadog-dd-trace-py-rkomorn Bot commented Feb 12, 2024

Copy link
Copy Markdown

Datadog Report

Branch report: rarguelloF/AIT-9563/dbm-peer-entity-tags
Commit report: e9e86ec
Test service: dd-trace-py

✅ 0 Failed, 27323 Passed, 33044 Skipped, 6h 48m 31.45s Total duration (1h 56m 42.81s time saved)

@rarguelloF
rarguelloF requested a review from tabgok February 15, 2024 12:27
@rarguelloF
rarguelloF marked this pull request as ready for review February 15, 2024 15:48
@rarguelloF
rarguelloF requested review from a team as code owners February 15, 2024 15:48
Comment thread ddtrace/propagation/_database_monitoring.py Outdated
@rarguelloF
rarguelloF merged commit 50c9215 into main Feb 26, 2024
@rarguelloF
rarguelloF deleted the rarguelloF/AIT-9563/dbm-peer-entity-tags branch February 26, 2024 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants