Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 2.x] Fix trace link in event viewer #1396

Merged
merged 1 commit into from
Jan 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
{
id: _.uniqueId('doc_viewer_tab_'),
name: 'Table',
component: (tabProps: any) => (

Check warning on line 42 in public/components/event_analytics/explorer/events_views/docViewer.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
<DocViewTable
filter={() => {}}
onAddColumn={() => {}}
Expand All @@ -52,7 +52,7 @@
{
id: _.uniqueId('doc_viewer_tab_'),
name: 'JSON',
component: (tabProps: any) => <JsonCodeBlock {...tabProps} />,

Check warning on line 55 in public/components/event_analytics/explorer/events_views/docViewer.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
otherProps: {},
},
{
Expand All @@ -64,7 +64,7 @@
</>
),

component: (tabProps: any) => <TraceBlock http={props.http} {...tabProps} />,

Check warning on line 67 in public/components/event_analytics/explorer/events_views/docViewer.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
otherProps: {},
},
];
Expand All @@ -88,7 +88,7 @@
),
};
});
}, [props.hit, logTraceId, tracesLink]);

Check warning on line 91 in public/components/event_analytics/explorer/events_views/docViewer.tsx

View workflow job for this annotation

GitHub Actions / Lint

React Hook useMemo has a missing dependency: 'getTabList'. Either include it or remove the dependency array

if (!tabs.length) {
// There there's a minimum of 2 tabs active in Discover.
Expand All @@ -96,19 +96,19 @@
return null;
}

useEffect(() => {

Check failure on line 99 in public/components/event_analytics/explorer/events_views/docViewer.tsx

View workflow job for this annotation

GitHub Actions / Lint

React Hook "useEffect" is called conditionally. React Hooks must be called in the exact same order in every component render
const traceId = props.hit.hasOwnProperty(OTEL_TRACE_ID) ? props.hit[OTEL_TRACE_ID] : '';
setLogTraceId(traceId);
if (traceId !== '' && isValidTraceId(traceId))
setTracesLink(
<EuiLink
className="trace-link"
href={`${observabilityTracesID}#/${traceId}`}
href={`${observabilityTracesID}#/traces/${traceId}`}
target="_blank"
external
/>
);
}, []);

Check warning on line 111 in public/components/event_analytics/explorer/events_views/docViewer.tsx

View workflow job for this annotation

GitHub Actions / Lint

React Hook useEffect has a missing dependency: 'props.hit'. Either include it or remove the dependency array

return (
<div className="osdDocViewer">
Expand Down
Loading