Skip to content

Commit 4c07d02

Browse files
authored
fix(otel): Make otel.kind be a string (#7182)
1 parent 1c9ed4f commit 4c07d02

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/opentelemetry-node/src/spanprocessor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { Context } from '@opentelemetry/api';
2-
import { trace } from '@opentelemetry/api';
2+
import { SpanKind, trace } from '@opentelemetry/api';
33
import type { Span as OtelSpan, SpanProcessor as OtelSpanProcessor } from '@opentelemetry/sdk-trace-base';
44
import { SemanticAttributes } from '@opentelemetry/semantic-conventions';
55
import { addGlobalEventProcessor, getCurrentHub } from '@sentry/core';
@@ -223,7 +223,7 @@ function updateSpanWithOtelData(sentrySpan: SentrySpan, otelSpan: OtelSpan): voi
223223
const { attributes, kind } = otelSpan;
224224

225225
sentrySpan.setStatus(mapOtelStatus(otelSpan));
226-
sentrySpan.setData('otel.kind', kind.valueOf());
226+
sentrySpan.setData('otel.kind', SpanKind[kind]);
227227

228228
Object.keys(attributes).forEach(prop => {
229229
const value = attributes[prop];

packages/opentelemetry-node/test/spanprocessor.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ describe('SentrySpanProcessor', () => {
221221
child.end();
222222

223223
expect(sentrySpan?.data).toEqual({
224-
'otel.kind': 0,
224+
'otel.kind': 'INTERNAL',
225225
'test-attribute': 'test-value',
226226
'test-attribute-2': [1, 2, 3],
227227
'test-attribute-3': 0,

0 commit comments

Comments
 (0)