Tempo: Show consistently named links for external reference types (#99008)

* Show consistently named links for external reference types

* Update betterer
This commit is contained in:
Joey
2025-01-30 15:14:38 +00:00
committed by GitHub
parent 3589d9192d
commit 64e9c38b66
3 changed files with 17 additions and 8 deletions
+1 -3
View File
@@ -5021,9 +5021,7 @@ exports[`better eslint`] = {
[0, 0, 0, "Do not use any type assertions.", "1"],
[0, 0, 0, "No untranslated strings in text props. Wrap text with <Trans /> or use t()", "2"],
[0, 0, 0, "No untranslated strings in text props. Wrap text with <Trans /> or use t()", "3"],
[0, 0, 0, "No untranslated strings in text props. Wrap text with <Trans /> or use t()", "4"],
[0, 0, 0, "No untranslated strings in text props. Wrap text with <Trans /> or use t()", "5"],
[0, 0, 0, "No untranslated strings in text props. Wrap text with <Trans /> or use t()", "6"]
[0, 0, 0, "No untranslated strings in text props. Wrap text with <Trans /> or use t()", "4"]
],
"public/app/features/explore/extensions/ConfirmNavigationModal.tsx:5381": [
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "0"],
@@ -29,7 +29,7 @@ export type TraceProcess = {
};
export type TraceSpanReference = {
refType: 'CHILD_OF' | 'FOLLOWS_FROM';
refType: 'CHILD_OF' | 'FOLLOWS_FROM' | 'EXTERNAL';
// eslint-disable-next-line no-use-before-define
span?: TraceSpan | null | undefined;
spanID: string;
@@ -29,6 +29,7 @@ import { ExploreFieldLinkModel, getFieldLinksForExplore, getVariableUsageInfo }
import { SpanLinkDef, SpanLinkFunc, Trace, TraceSpan } from './components';
import { SpanLinkType } from './components/types/links';
import { TraceSpanReference } from './components/types/trace';
/**
* This is a factory for the link creator. It returns the function mainly so it can return undefined in which case
@@ -323,11 +324,12 @@ function legacyCreateSpanLinkFactory(
}
const link = createFocusSpanLink(reference.traceID, reference.spanID);
const title = getReferenceTitle(reference);
links!.push({
href: link.href,
title: reference.span ? reference.span.operationName : 'View linked span',
content: <Icon name="link" title="View linked span" />,
title,
content: <Icon name="link" title={title} />,
onClick: link.onClick,
field: link.origin,
type: SpanLinkType.Traces,
@@ -338,11 +340,12 @@ function legacyCreateSpanLinkFactory(
if (span.subsidiarilyReferencedBy && createFocusSpanLink) {
for (const reference of span.subsidiarilyReferencedBy) {
const link = createFocusSpanLink(reference.traceID, reference.spanID);
const title = getReferenceTitle(reference);
links!.push({
href: link.href,
title: reference.span ? reference.span.operationName : 'View linked span',
content: <Icon name="link" title="View linked span" />,
title,
content: <Icon name="link" title={title} />,
onClick: link.onClick,
field: link.origin,
type: SpanLinkType.Traces,
@@ -366,6 +369,14 @@ function legacyCreateSpanLinkFactory(
};
}
const getReferenceTitle = (reference: TraceSpanReference) => {
let title = reference.span ? reference.span.operationName : 'View linked span';
if (reference.refType === 'EXTERNAL') {
title = 'View linked span';
}
return title;
};
function getQueryForLoki(
span: TraceSpan,
options: TraceToLogsOptionsV2,