From dbbbeb2990b9d3ad461302dc037c617da24a0e72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Onuki?= Date: Thu, 28 Sep 2023 11:46:04 -0400 Subject: [PATCH] Setting thread.id as an intrinsic (#1521) --- .../com/newrelic/agent/service/analytics/SpanEventFactory.java | 2 +- .../newrelic/agent/service/analytics/SpanEventFactoryTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/newrelic-agent/src/main/java/com/newrelic/agent/service/analytics/SpanEventFactory.java b/newrelic-agent/src/main/java/com/newrelic/agent/service/analytics/SpanEventFactory.java index b8c44cd962..c1abd31816 100644 --- a/newrelic-agent/src/main/java/com/newrelic/agent/service/analytics/SpanEventFactory.java +++ b/newrelic-agent/src/main/java/com/newrelic/agent/service/analytics/SpanEventFactory.java @@ -121,7 +121,7 @@ public SpanEventFactory setClmAttributes(Map agentAttributes) { } final Object threadId = agentAttributes.get(AttributeNames.THREAD_ID); if (threadId != null) { - builder.putAgentAttribute(AttributeNames.THREAD_ID, threadId); + builder.putIntrinsic(AttributeNames.THREAD_ID, threadId); } if (agentAttributes.containsKey(AttributeNames.CLM_NAMESPACE) && agentAttributes.containsKey(AttributeNames.CLM_FUNCTION)) { builder.putAgentAttribute(AttributeNames.CLM_NAMESPACE, agentAttributes.get(AttributeNames.CLM_NAMESPACE)); diff --git a/newrelic-agent/src/test/java/com/newrelic/agent/service/analytics/SpanEventFactoryTest.java b/newrelic-agent/src/test/java/com/newrelic/agent/service/analytics/SpanEventFactoryTest.java index 72c6ab8399..c530ef1534 100644 --- a/newrelic-agent/src/test/java/com/newrelic/agent/service/analytics/SpanEventFactoryTest.java +++ b/newrelic-agent/src/test/java/com/newrelic/agent/service/analytics/SpanEventFactoryTest.java @@ -191,7 +191,7 @@ public void shouldSetCLMParameters() { assertEquals("nr", target.getAgentAttributes().get(AttributeNames.CLM_NAMESPACE)); assertEquals("process", target.getAgentAttributes().get(AttributeNames.CLM_FUNCTION)); - assertEquals(666, target.getAgentAttributes().get(AttributeNames.THREAD_ID)); + assertEquals(666, target.getIntrinsics().get(AttributeNames.THREAD_ID)); } @Test