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',
},
{
key: 'pyroscope.profiling.enabled',
key: 'pyroscope.profile.id',
value: 'hdgfljn23u982nj',
},
],

View File

@ -85,7 +85,7 @@ export function createSpanLinkFactory({
profilesDataSourceSettings = getDatasourceSrv().getInstanceSettings(traceToProfilesOptions.datasourceUid);
}
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;
let links: ExploreFieldLinkModel[] = [];

View File

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