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

feat: Added timeslice metrics recorders for synthesized db segments #2922

Merged
merged 2 commits into from
Feb 6, 2025

Conversation

bizob2828
Copy link
Member

Description

The PR assigns the appropriate time slice metrics recorder depending on the otel span. It uses the database recorder when it is a query and database operation when it is redis or memcached. I also added some versioned tests to verify the timeslice metrics are occurring. Lastly, I added a method to reconcile the segment attributes when a span ends. This basically maps the span attributes to segment attributes so when the agent re-creates spans from segments it assigns the appropriate attributes on span but retains the expected attributes on segment. If this mapping doesn't occur the attributes are the segment would be incorrect.

Related Issues

Closes #2653

Copy link

codecov bot commented Feb 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.38%. Comparing base (e049442) to head (cebc17b).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2922      +/-   ##
==========================================
+ Coverage   88.69%   97.38%   +8.69%     
==========================================
  Files         312      314       +2     
  Lines       47635    48074     +439     
==========================================
+ Hits        42248    46817    +4569     
+ Misses       5387     1257    -4130     
Flag Coverage Δ
integration-tests-cjs-18.x 72.32% <33.62%> (?)
integration-tests-cjs-20.x 72.32% <33.62%> (?)
integration-tests-cjs-22.x 72.55% <33.62%> (-0.15%) ⬇️
integration-tests-esm-18.x 49.62% <33.62%> (+0.01%) ⬆️
integration-tests-esm-20.x 49.63% <33.62%> (+0.01%) ⬆️
integration-tests-esm-22.x 49.68% <33.62%> (+0.01%) ⬆️
unit-tests-18.x 89.15% <70.68%> (?)
unit-tests-20.x 89.15% <70.68%> (?)
unit-tests-22.x 89.17% <70.68%> (?)
versioned-tests-18.x 79.21% <100.00%> (-0.21%) ⬇️
versioned-tests-20.x 79.21% <100.00%> (-0.21%) ⬇️
versioned-tests-22.x 79.22% <100.00%> (-0.21%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bizob2828 bizob2828 merged commit 8606f78 into newrelic:main Feb 6, 2025
27 checks passed
@bizob2828 bizob2828 deleted the db-timeslice-metrics branch February 6, 2025 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done: Issues recently completed
Development

Successfully merging this pull request may close these issues.

Create db metrics for client db otel spans
2 participants