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

[Bug]fixed traces bug for missing MDS id #2100

Merged
merged 3 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
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 @@ -54,16 +54,16 @@
} from '../../../../public/components/trace_analytics/components/common/helper_functions';
import { SpanDetailFlyout } from '../../../../public/components/trace_analytics/components/traces/span_detail_flyout';
import { SpanDetailTable } from '../../../../public/components/trace_analytics/components/traces/span_detail_table';
import { HeaderControlledComponentsWrapper } from '../../../../public/plugin_helpers/plugin_headerControl';
import { TracesContent } from '../../../components/trace_analytics/components/traces/traces_content';
import { coreRefs } from '../../../framework/core_refs';
import { Explorer } from '../../event_analytics/explorer/explorer';
import { ServicesContent } from '../../trace_analytics/components/services/services_content';
import { fetchAppById, initializeTabData } from '../helpers/utils';
import { AppAnalyticsComponentDeps } from '../home';
import { Configuration } from './configuration';
import { ServiceDetailFlyout } from './flyout_components/service_detail_flyout';
import { TraceDetailFlyout } from './flyout_components/trace_detail_flyout';
import { coreRefs } from '../../../framework/core_refs';
import { HeaderControlledComponentsWrapper } from '../../../../public/plugin_helpers/plugin_headerControl';

const newNavigation = coreRefs.chrome?.navGroup.getNavGroupEnabled();

Expand Down Expand Up @@ -134,7 +134,7 @@
const [serviceFlyoutName, setServiceFlyoutName] = useState<string>('');
const [traceFlyoutId, setTraceFlyoutId] = useState<string>('');
const [spanFlyoutId, setSpanFlyoutId] = useState<string>('');
const [spanDSL, setSpanDSL] = useState<any>({});

Check warning on line 137 in public/components/application_analytics/components/application.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
const [totalSpans, setTotalSpans] = useState<number>(0);
const [editVizId, setEditVizId] = useState<string>('');
const [visWithAvailability, setVisWithAvailability] = useState<EuiSelectOption[]>([]);
Expand All @@ -157,7 +157,7 @@
sessionStorage.setItem(`${application.name}EndTime`, newEndTime);
};

const addSpanFilter = (field: string, value: any) => {

Check warning on line 160 in public/components/application_analytics/components/application.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
const newFilters = [...filters];
const index = newFilters.findIndex(({ field: filterField }) => field === filterField);
if (index === -1) {
Expand Down Expand Up @@ -286,7 +286,7 @@
},
];

const nameColumnAction = (item: any) => openServiceFlyout(item);

Check warning on line 289 in public/components/application_analytics/components/application.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
const traceColumnAction = () => switchToTrace();

const getService = () => {
Expand Down Expand Up @@ -570,6 +570,7 @@
traceId={traceFlyoutId}
closeTraceFlyout={closeTraceFlyout}
openSpanFlyout={openSpanFlyout}
dataSourceMDSId=""
/>
)}
</EuiPage>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,19 @@ interface TraceFlyoutProps extends TraceAnalyticsComponentDeps {
traceId: string;
closeTraceFlyout: () => void;
openSpanFlyout: (spanId: string) => void;
dataSourceMDSId: string;
}

export function TraceDetailFlyout(props: TraceFlyoutProps) {
const { traceId, http, closeTraceFlyout, openSpanFlyout } = props;
const { traceId, http, closeTraceFlyout, openSpanFlyout, dataSourceMDSId } = props;
const renderContent = (
<TraceDetailRender traceId={traceId} http={http} openSpanFlyout={openSpanFlyout} mode='data_prepper'/>
<TraceDetailRender
traceId={traceId}
http={http}
openSpanFlyout={openSpanFlyout}
mode="data_prepper"
dataSourceMDSId={dataSourceMDSId}
/>
);
return (
<EuiFlyout data-test-subj="traceDetailFlyout" onClose={closeTraceFlyout} size="m">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,18 @@
http: HttpStart;
openSpanFlyout: (spanId: string) => void;
mode: TraceAnalyticsMode;
dataSourceMDSId: string;
}

export const TraceDetailRender = ({
traceId,
http,
openSpanFlyout,
mode,
dataSourceMDSId,

Check failure on line 33 in public/components/application_analytics/components/flyout_components/trace_detail_render.tsx

View workflow job for this annotation

GitHub Actions / Lint

Delete `⏎`
}: TraceDetailRenderProps) => {
const [fields, setFields] = useState<any>({});

Check warning on line 35 in public/components/application_analytics/components/flyout_components/trace_detail_render.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
const [serviceBreakdownData, setServiceBreakdownData] = useState([]);
const [payloadData, setPayloadData] = useState('');
const [colorMap, setColorMap] = useState({});
Expand Down Expand Up @@ -74,6 +77,7 @@
page="app"
openSpanFlyout={openSpanFlyout}
mode={mode}
dataSourceMDSId={dataSourceMDSId}
/>
<EuiSpacer size="xs" />
<EuiHorizontalRule margin="s" />
Expand All @@ -88,13 +92,13 @@
) : null}
</>
);
}, [traceId, fields, serviceBreakdownData, colorMap, payloadData]);

Check warning on line 95 in public/components/application_analytics/components/flyout_components/trace_detail_render.tsx

View workflow job for this annotation

GitHub Actions / Lint

React Hook useMemo has missing dependencies: 'dataSourceMDSId', 'http', 'mode', and 'openSpanFlyout'. Either include them or remove the dependency array

useEffect(() => {
handleTraceViewRequest(traceId, http, fields, setFields, mode);
handleServicesPieChartRequest(traceId, http, setServiceBreakdownData, setColorMap, mode);
handlePayloadRequest(traceId, http, payloadData, setPayloadData, mode);
}, [traceId]);

Check warning on line 101 in public/components/application_analytics/components/flyout_components/trace_detail_render.tsx

View workflow job for this annotation

GitHub Actions / Lint

React Hook useEffect has missing dependencies: 'fields', 'http', 'mode', and 'payloadData'. Either include them or remove the dependency array

return renderContent;
};
Loading