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

Peer Service Precursors for DBM #2664

Merged
merged 2 commits into from
May 17, 2024
Merged

Peer Service Precursors for DBM #2664

merged 2 commits into from
May 17, 2024

Conversation

PROFeNoM
Copy link
Contributor

@PROFeNoM PROFeNoM commented May 15, 2024

Description

Please take a look at AIT-10031 for the full details (contains the short RFC).

Changed

  • dddbs: It should NOT be overridden by peer.service. There is some fake service thingy in the RFC, but I don't believe it applies there? Or there is something that I'm unaware of

Added

  • ddh: The hostname of the database server
  • dddb: The schema/database/namespace
  • ddprs: Value of peer.service if and only if the customer explicitly sets this

Reviewer checklist

  • Test coverage seems ok.
  • Appropriate labels assigned.

@codecov-commenter
Copy link

codecov-commenter commented May 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.23%. Comparing base (3d5be50) to head (6ebc1db).
Report is 1 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2664      +/-   ##
============================================
+ Coverage     77.66%   79.23%   +1.56%     
- Complexity     2210     2213       +3     
============================================
  Files           225      199      -26     
  Lines         26080    22078    -4002     
  Branches        988        0     -988     
============================================
- Hits          20256    17494    -2762     
+ Misses         5298     4584     -714     
+ Partials        526        0     -526     
Flag Coverage Δ
appsec-extension ?
tracer-extension 78.46% <ø> (ø)
tracer-php 80.32% <100.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...DDTrace/Integrations/DatabaseIntegrationHelper.php 96.05% <100.00%> (+0.97%) ⬆️

... and 26 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3d5be50...6ebc1db. Read the comment docs.

@PROFeNoM PROFeNoM marked this pull request as ready for review May 15, 2024 11:29
@PROFeNoM PROFeNoM requested review from a team as code owners May 15, 2024 11:30
@PROFeNoM PROFeNoM self-assigned this May 15, 2024
@pr-commenter
Copy link

pr-commenter bot commented May 15, 2024

Benchmarks

Benchmark execution time: 2024-05-17 08:02:11

Comparing candidate commit 6ebc1db in PR branch alex/dbm/ddprs-dddbs with baseline commit 3d5be50 in branch master.

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

Comment on lines 84 to 86
if ($targetHost != "") {
$tags[Tag::DBM_PEER_HOSTNAME] = $targetHost;
}
Copy link
Collaborator

@bwoebi bwoebi May 15, 2024

Choose a reason for hiding this comment

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

This is not visible anymore given that you put these as constants, but this is "ddh", which is not respecting the order (before is "dddbs", next is "dddb"), see the // Note a few lines above.
Hence, to make this much more visible, I would recommend not using Tag:: here, but just adding it as a comment, e.g.

// peer hostname
$tags["ddh"] = $targetHost;

The strength of constants is when they are reused, but here's no reuse at all, so I think the approach with the comment would be better.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

which is not respecting the order

Wasn't aware there was an order

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll make the changes

Copy link
Collaborator

Choose a reason for hiding this comment

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

It may also make sense to have a test actually verify these are ordered. At least you missed the comment in the source file :-D Others might too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

:)

@PROFeNoM PROFeNoM marked this pull request as draft May 15, 2024 12:37
@PROFeNoM PROFeNoM marked this pull request as ready for review May 15, 2024 13:02
$query = self::propagateViaSqlComments($hook->args[$argNum], $databaseService, $propagationMode);
$targetHost = $span->meta[Tag::TARGET_HOST] ?? '';
$dbName = $span->meta[Tag::DB_NAME] ?? $span->meta[Tag::DB_INSTANCE] ?? '';
$peerService = $span->meta['peer.service'] ?? '';
Copy link

Choose a reason for hiding this comment

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

nit: this seems like the only tag not specified as Tag::... and I'm not sure if that's intentional or not

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this was sort of intentional since there is no Tag::PEER_SERVICE. I can add it - won't make any harm

Copy link

@tabgok tabgok left a comment

Choose a reason for hiding this comment

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

Approving from a "this does the right thing for DBM comments" perspective

Co-authored-by: Bob Weinand <bob.weinand@datadoghq.com>
Copy link
Collaborator

@bwoebi bwoebi left a comment

Choose a reason for hiding this comment

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

LGTM now :-)

@PROFeNoM PROFeNoM merged commit 48190be into master May 17, 2024
553 of 556 checks passed
@PROFeNoM PROFeNoM deleted the alex/dbm/ddprs-dddbs branch May 17, 2024 11:14
@bwoebi bwoebi added this to the 1.0.0 milestone May 27, 2024
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.

None yet

4 participants