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

Traces - Gantt chart / Span list rework #2257

Merged
merged 15 commits into from
Dec 5, 2024

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@
openSpanFlyout,
mode,
dataSourceMDSId,

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

Check warning on line 34 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 @@ -78,6 +77,7 @@
openSpanFlyout={openSpanFlyout}
mode={mode}
dataSourceMDSId={dataSourceMDSId}
isApplicationFlyout={true}
/>
<EuiSpacer size="xs" />
<EuiHorizontalRule margin="s" />
Expand All @@ -92,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;
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@
/* eslint-disable radix */

import dateMath from '@elastic/datemath';
import { EuiEmptyPrompt, EuiSmallButtonEmpty, EuiSpacer, EuiText } from '@elastic/eui';
import {
EuiButtonIcon,
EuiEmptyPrompt,
EuiOverlayMask,
EuiSmallButtonEmpty,
EuiSpacer,
EuiText,
} from '@elastic/eui';
import { SpacerSize } from '@elastic/eui/src/components/spacer/spacer';
import { isEmpty, round } from 'lodash';
import React from 'react';
Expand Down Expand Up @@ -329,7 +336,7 @@
percentileMaps: Array<{ traceGroupName: string; durationFilter: { gte?: number; lte?: number } }>,
conditionString: string // >= 95th, < 95th
): FilterType => {
const DSL: any = {

Check warning on line 339 in public/components/trace_analytics/components/common/helper_functions.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
query: {
bool: {
must: [],
Expand Down Expand Up @@ -374,12 +381,12 @@
mode: TraceAnalyticsMode,
filters: FilterType[],
query: string,
startTime: any,

Check warning on line 384 in public/components/trace_analytics/components/common/helper_functions.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
endTime: any,

Check warning on line 385 in public/components/trace_analytics/components/common/helper_functions.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
page?: string,
appConfigs: FilterType[] = []
) => {
const DSL: any = {

Check warning on line 389 in public/components/trace_analytics/components/common/helper_functions.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
query: {
bool: {
must: [],
Expand Down Expand Up @@ -582,3 +589,33 @@

return `${url}&datasourceId=`;
};

interface FullScreenWrapperProps {
children: React.ReactNode;
onClose: () => void;
isFullScreen: boolean;
}

// EUI Data grid full screen button is currently broken, this is a workaround
export const FullScreenWrapper: React.FC<FullScreenWrapperProps> = ({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add some comments above to explain what it does or why it's needed

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added above
//EUI Data grid full screen button is currently broken, this is a workaround using overlay mask

children,
onClose,
isFullScreen,
}) => {
if (!isFullScreen) return <>{children}</>;

return (
<EuiOverlayMask>
<div className="full-screen-wrapper">
<EuiButtonIcon
iconType="cross"
aria-label="Close full screen"
onClick={onClose}
display="empty"
className="full-screen-close-icon"
/>
<div className="full-screen-content">{children}</div>
</div>
</EuiOverlayMask>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
const [redirect, setRedirect] = useState(true);
const [loading, setLoading] = useState(false);
const [filteredService, setFilteredService] = useState('');
const [selectedItems, setSelectedItems] = useState<any[]>([]);

Check warning on line 59 in public/components/trace_analytics/components/services/services_content.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
const [isServiceTrendEnabled, setIsServiceTrendEnabled] = useState(false);
const [serviceTrends, setServiceTrends] = useState<ServiceTrends>({});
const searchBarRef = useRef<{ updateQuery: (newQuery: string) => void }>(null);
Expand Down Expand Up @@ -100,6 +100,9 @@
jaegerIndicesExist,
dataPrepperIndicesExist,
isServiceTrendEnabled,
startTime,
endTime,
props.dataSourceMDSId,
]);

const refresh = async (currService?: string, overrideQuery?: string) => {
Expand All @@ -117,7 +120,7 @@
// service map should not be filtered by service name
const serviceMapDSL = cloneDeep(DSL);
serviceMapDSL.query.bool.must = serviceMapDSL.query.bool.must.filter(
(must: any) => must?.term?.serviceName == null

Check warning on line 123 in public/components/trace_analytics/components/services/services_content.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
);

if (isServiceTrendEnabled) {
Expand Down
Loading
Loading