mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Tempo: Fix Otel span kind mapping in trace upload resultTransformer (#43168)
* Fix otel span kind mapping * Parse span kind from enum string
This commit is contained in:
parent
c4c05a5b71
commit
dc92cee874
@ -10,7 +10,7 @@ import {
|
||||
TraceLog,
|
||||
TraceSpanRow,
|
||||
} from '@grafana/data';
|
||||
import { SpanKind, SpanStatus, SpanStatusCode } from '@opentelemetry/api';
|
||||
import { SpanStatus, SpanStatusCode } from '@opentelemetry/api';
|
||||
import { collectorTypes } from '@opentelemetry/exporter-collector';
|
||||
import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions';
|
||||
import { createGraphFrames } from './graphTransform';
|
||||
@ -216,13 +216,11 @@ function getSpanTags(
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
span.kind !== undefined &&
|
||||
span.kind !== collectorTypes.opentelemetryProto.trace.v1.Span.SpanKind.SPAN_KIND_INTERNAL
|
||||
) {
|
||||
if (span.kind !== undefined) {
|
||||
const split = span.kind.toString().toLowerCase().split('_');
|
||||
spanTags.push({
|
||||
key: 'span.kind',
|
||||
value: SpanKind[collectorTypes.opentelemetryProto.trace.v1.Span.SpanKind[span.kind] as any].toLowerCase(),
|
||||
value: split.length ? split[split.length - 1] : span.kind.toString(),
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -2000,7 +2000,7 @@ export const otlpDataFrameFromResponse = new MutableDataFrame({
|
||||
},
|
||||
{
|
||||
key: 'span.kind',
|
||||
value: 'producer',
|
||||
value: 'client',
|
||||
},
|
||||
],
|
||||
],
|
||||
|
Loading…
Reference in New Issue
Block a user