Tempo: Update tag in span based on Pyroscope API (#77701)

* Update tags key

* Update link tags

* Update test
This commit is contained in:
Joey 2023-11-07 08:45:09 +00:00 committed by GitHub
parent 6e929b2b53
commit de9ee2e127
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -1555,7 +1555,7 @@ function createTraceSpan(overrides: Partial<TraceSpan> = {}) {
value: 'host', value: 'host',
}, },
{ {
key: 'pyroscope.profiling.enabled', key: 'pyroscope.profile.id',
value: 'hdgfljn23u982nj', value: 'hdgfljn23u982nj',
}, },
], ],

View File

@ -85,7 +85,7 @@ export function createSpanLinkFactory({
profilesDataSourceSettings = getDatasourceSrv().getInstanceSettings(traceToProfilesOptions.datasourceUid); profilesDataSourceSettings = getDatasourceSrv().getInstanceSettings(traceToProfilesOptions.datasourceUid);
} }
const hasConfiguredPyroscopeDS = profilesDataSourceSettings?.type === 'grafana-pyroscope-datasource'; const hasConfiguredPyroscopeDS = profilesDataSourceSettings?.type === 'grafana-pyroscope-datasource';
const hasPyroscopeProfile = span.tags.filter((tag) => tag.key === 'pyroscope.profiling.enabled').length > 0; const hasPyroscopeProfile = span.tags.filter((tag) => tag.key === 'pyroscope.profile.id').length > 0;
const shouldCreatePyroscopeLink = hasConfiguredPyroscopeDS && hasPyroscopeProfile; const shouldCreatePyroscopeLink = hasConfiguredPyroscopeDS && hasPyroscopeProfile;
let links: ExploreFieldLinkModel[] = []; let links: ExploreFieldLinkModel[] = [];

View File

@ -533,7 +533,7 @@ export function transformTrace(
groupBy: [], groupBy: [],
profileTypeId: traceToProfilesOptions.profileTypeId ?? '', profileTypeId: traceToProfilesOptions.profileTypeId ?? '',
queryType: 'profile', queryType: 'profile',
spanSelector: ['${__span.spanId}'], spanSelector: ['${__span.tags["pyroscope.profile.id"]}'],
refId: 'profile', refId: 'profile',
}, },
}, },