diff --git a/public/app/features/logs/components/panel/LogLineDetails.test.tsx b/public/app/features/logs/components/panel/LogLineDetails.test.tsx index c42481d85f9..085b4e2c8cb 100644 --- a/public/app/features/logs/components/panel/LogLineDetails.test.tsx +++ b/public/app/features/logs/components/panel/LogLineDetails.test.tsx @@ -742,4 +742,26 @@ describe('LogLineDetails', () => { expect(screen.getByText('Could not retrieve trace.')).toBeInTheDocument(); }); + + test('shows attribute extension links when they are available', () => { + const usePluginLinksMock = jest.fn().mockReturnValue({ + links: [ + { + type: 'link', + title: 'Open service overview for label', + path: 'https://example.com', + category: 'label', + icon: 'compass', + }, + ], + }); + setPluginLinksHook(usePluginLinksMock); + jest.requireMock('@grafana/runtime').usePluginLinks = usePluginLinksMock; + + setup(undefined, { labels: { label: 'value' } }); + + expect(screen.getByText('label')).toBeInTheDocument(); + expect(screen.getByText('value')).toBeInTheDocument(); + expect(screen.getByText('Open service overview for label')).toBeInTheDocument(); + }); }); diff --git a/public/app/features/logs/components/panel/LogLineDetailsComponent.tsx b/public/app/features/logs/components/panel/LogLineDetailsComponent.tsx index 34f2f25ccb1..65bdeb16f4a 100644 --- a/public/app/features/logs/components/panel/LogLineDetailsComponent.tsx +++ b/public/app/features/logs/components/panel/LogLineDetailsComponent.tsx @@ -63,7 +63,7 @@ export const LogLineDetailsComponent = memo( .map((label) => ({ key: label, value: log.labels[label], - link: extensionLinks?.[label], + links: extensionLinks?.[label], })), [extensionLinks, log.labels] ); diff --git a/public/app/features/logs/components/panel/LogLineDetailsFields.tsx b/public/app/features/logs/components/panel/LogLineDetailsFields.tsx index 3ddd0b29f8f..961dbff024d 100644 --- a/public/app/features/logs/components/panel/LogLineDetailsFields.tsx +++ b/public/app/features/logs/components/panel/LogLineDetailsFields.tsx @@ -339,7 +339,7 @@ export const LogLineDetailsField = ({ } return (
-
+
-
({ }, }), link: css({ - gridColumn: 'span 3', - }), - linkNoActions: css({ - gridColumn: 'span 2', + gridColumn: '2 / 4', }), stats: css({ paddingRight: theme.spacing(1), @@ -412,7 +408,7 @@ const getFieldStyles = (theme: GrafanaTheme2) => ({ maxWidth: '50vh', }), statsColumn: css({ - gridColumn: 'span 2', + gridColumn: '2 / 4', }), valueContainer: css({ display: 'flex',