Skip to content

Commit 37ce113

Browse files
authored
fix: Updated the kafkajs node metrics to remove /Named from the name (#2458)
1 parent 41f33c8 commit 37ce113

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/instrumentation/kafkajs/record-linking-metrics.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function recordLinkingMetrics({ agent, brokers, topic, producer = true }) {
1111
const kind = producer === true ? 'Produce' : 'Consume'
1212
for (const broker of brokers) {
1313
agent.metrics
14-
.getOrCreateMetric(`MessageBroker/Kafka/Nodes/${broker}/${kind}/Named/${topic}`)
14+
.getOrCreateMetric(`MessageBroker/Kafka/Nodes/${broker}/${kind}/${topic}`)
1515
.incrementCallCount()
1616
}
1717
}

test/versioned/kafkajs/kafka.tap.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ tap.test('send records correctly', (t) => {
7575
t.equal(sendMetric.callCount, 1)
7676

7777
const produceTrackingMetric = agent.metrics.getMetric(
78-
`MessageBroker/Kafka/Nodes/${broker}/Produce/Named/${topic}`
78+
`MessageBroker/Kafka/Nodes/${broker}/Produce/${topic}`
7979
)
8080
t.equal(produceTrackingMetric.callCount, 1)
8181
}
@@ -205,7 +205,7 @@ tap.test('sendBatch records correctly', (t) => {
205205
t.equal(sendMetric.callCount, 1)
206206

207207
const produceTrackingMetric = agent.metrics.getMetric(
208-
`MessageBroker/Kafka/Nodes/${broker}/Produce/Named/${topic}`
208+
`MessageBroker/Kafka/Nodes/${broker}/Produce/${topic}`
209209
)
210210
t.equal(produceTrackingMetric.callCount, 1)
211211

@@ -262,7 +262,7 @@ tap.test('consume outside of a transaction', async (t) => {
262262
t.equal(sendMetric.callCount, 1)
263263

264264
const consumeTrackingMetric = agent.metrics.getMetric(
265-
`MessageBroker/Kafka/Nodes/${broker}/Consume/Named/${topic}`
265+
`MessageBroker/Kafka/Nodes/${broker}/Consume/${topic}`
266266
)
267267
t.equal(consumeTrackingMetric.callCount, 1)
268268

@@ -376,7 +376,7 @@ tap.test('consume batch inside of a transaction', async (t) => {
376376
t.equal(sendMetric.callCount, 1)
377377

378378
const consumeTrackingMetric = agent.metrics.getMetric(
379-
`MessageBroker/Kafka/Nodes/${broker}/Consume/Named/${topic}`
379+
`MessageBroker/Kafka/Nodes/${broker}/Consume/${topic}`
380380
)
381381
t.equal(consumeTrackingMetric.callCount, 1)
382382

0 commit comments

Comments
 (0)