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 consumer timeslice metrics from otel #2938

Merged
merged 5 commits into from
Feb 13, 2025

Conversation

jsumners-nr
Copy link
Contributor

This PR resolves #2929.

Copy link

codecov bot commented Feb 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.30%. Comparing base (b85111c) to head (79b0927).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2938      +/-   ##
==========================================
- Coverage   97.35%   97.30%   -0.05%     
==========================================
  Files         317      317              
  Lines       48619    48648      +29     
==========================================
+ Hits        47331    47338       +7     
- Misses       1288     1310      +22     
Flag Coverage Δ
integration-tests-cjs-18.x 72.36% <81.48%> (+<0.01%) ⬆️
integration-tests-cjs-20.x 72.36% <81.48%> (+<0.01%) ⬆️
integration-tests-cjs-22.x 72.58% <81.48%> (+<0.01%) ⬆️
integration-tests-esm-18.x 49.96% <81.48%> (+0.01%) ⬆️
integration-tests-esm-20.x 49.97% <81.48%> (+0.01%) ⬆️
integration-tests-esm-22.x 50.02% <81.48%> (+0.01%) ⬆️
unit-tests-18.x 89.06% <100.00%> (+<0.01%) ⬆️
unit-tests-20.x 89.06% <100.00%> (+<0.01%) ⬆️
unit-tests-22.x 89.07% <100.00%> (+<0.01%) ⬆️
versioned-tests-18.x 79.56% <100.00%> (-0.12%) ⬇️
versioned-tests-20.x 79.56% <100.00%> (-0.12%) ⬇️
versioned-tests-22.x 79.57% <100.00%> (-0.12%) ⬇️

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.

@jsumners-nr jsumners-nr marked this pull request as ready for review February 11, 2025 17:00
Copy link
Member

@bizob2828 bizob2828 left a comment

Choose a reason for hiding this comment

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

few little tweaks, overall looks good

@@ -37,9 +38,11 @@ function createConsumerSegment(agent, otelSpan) {
// 'host',
//
// )
transaction.name = segmentName
transaction.setPartialName(segmentName)
Copy link
Member

Choose a reason for hiding this comment

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

you don't finalize the name here. That will be done in the onEnd when we end the consumer span's transaction later. Also the segmentName only needs to be ${system}/${destKind}/Named/${destination}.


const segment = agent.tracer.createSegment({
recorder,
name: segmentName,
Copy link
Member

Choose a reason for hiding this comment

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

based on the message-shim/subscribe-consume. this needs to be transaction.getFullName()

@@ -59,8 +59,8 @@ test('should create consumer segment from otel span', (t) => {
const { segment, transaction } = synth.synthesize(span)
assert.equal(segment.name, expectedName)
assert.equal(segment.parentId, segment.root.id)
assert.equal(transaction.name, expectedName)
assert.equal(transaction.type, 'bg')
assert.equal(transaction.name.endsWith(expectedName), true)
Copy link
Member

Choose a reason for hiding this comment

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

this name should match exactly. the only thing you'll have to do before this, for now, is end the transaction. Once the reconciliation ticket is done(#2932) when the consumer span ends it will end the transsaction

const expectedMetrics = [
'OtherTransaction/all',
'OtherTransaction/Message/all',
'OtherTransaction/Message/OtherTransaction/Message/kafka/queue/Named/work-queue',
Copy link
Member

Choose a reason for hiding this comment

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

these names will need to be updated once you fix the suggestions in the consumer synthesizer. it shouldn't have OtherTransaction/Message twice

@bizob2828 bizob2828 merged commit acfe953 into newrelic:main Feb 13, 2025
26 of 27 checks passed
@jsumners-nr jsumners-nr deleted the issue-2929 branch February 13, 2025 16:52
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 timeslice metrics for consumer spans
2 participants