mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-14 05:45:56 +08:00
Merge branch 'pull-68' into main
This commit is contained in:
commit
c22d6dd1cc
@ -91,7 +91,15 @@ export const getOptions = (theme: string): ChartOptions => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const borderColors = [
|
export const borderColors = [
|
||||||
"rgba(250,174,50,1)",
|
"#00feff",
|
||||||
"rgba(227, 74, 51, 1.0)",
|
"rgba(227, 74, 51, 1.0)",
|
||||||
|
"rgba(250,174,50,1)",
|
||||||
|
"#058b00",
|
||||||
|
"#a47f00",
|
||||||
"rgba(57, 255, 20, 1.0)",
|
"rgba(57, 255, 20, 1.0)",
|
||||||
|
"#45a1ff",
|
||||||
|
"#ffe900",
|
||||||
|
"#30e60b",
|
||||||
|
"#8000d7",
|
||||||
|
"#ededf0"
|
||||||
];
|
];
|
||||||
|
@ -9,10 +9,12 @@ import {
|
|||||||
getServicesMetrics,
|
getServicesMetrics,
|
||||||
metricItem,
|
metricItem,
|
||||||
getTopEndpoints,
|
getTopEndpoints,
|
||||||
|
getDbOverViewMetrics,
|
||||||
getExternalMetrics,
|
getExternalMetrics,
|
||||||
externalMetricsAvgDurationItem,
|
externalMetricsAvgDurationItem,
|
||||||
externalErrCodeMetricsItem,
|
externalErrCodeMetricsItem,
|
||||||
externalMetricsItem,
|
externalMetricsItem,
|
||||||
|
dbOverviewMetricsItem,
|
||||||
getExternalAvgDurationMetrics,
|
getExternalAvgDurationMetrics,
|
||||||
getExternalErrCodeMetrics,
|
getExternalErrCodeMetrics,
|
||||||
topEndpointListItem,
|
topEndpointListItem,
|
||||||
@ -30,10 +32,12 @@ const { TabPane } = Tabs;
|
|||||||
|
|
||||||
interface ServicesMetricsProps extends RouteComponentProps<any> {
|
interface ServicesMetricsProps extends RouteComponentProps<any> {
|
||||||
serviceMetrics: metricItem[];
|
serviceMetrics: metricItem[];
|
||||||
|
dbOverviewMetrics: dbOverviewMetricsItem[];
|
||||||
getServicesMetrics: Function;
|
getServicesMetrics: Function;
|
||||||
getExternalMetrics: Function;
|
getExternalMetrics: Function;
|
||||||
getExternalErrCodeMetrics: Function;
|
getExternalErrCodeMetrics: Function;
|
||||||
getExternalAvgDurationMetrics: Function;
|
getExternalAvgDurationMetrics: Function;
|
||||||
|
getDbOverViewMetrics: Function;
|
||||||
externalMetrics: externalMetricsItem[];
|
externalMetrics: externalMetricsItem[];
|
||||||
topEndpointsList: topEndpointListItem[];
|
topEndpointsList: topEndpointListItem[];
|
||||||
externalAvgDurationMetrics: externalMetricsAvgDurationItem[];
|
externalAvgDurationMetrics: externalMetricsAvgDurationItem[];
|
||||||
@ -51,6 +55,7 @@ const _ServiceMetrics = (props: ServicesMetricsProps) => {
|
|||||||
props.getExternalMetrics(servicename, props.globalTime);
|
props.getExternalMetrics(servicename, props.globalTime);
|
||||||
props.getExternalErrCodeMetrics(servicename, props.globalTime);
|
props.getExternalErrCodeMetrics(servicename, props.globalTime);
|
||||||
props.getExternalAvgDurationMetrics(servicename, props.globalTime);
|
props.getExternalAvgDurationMetrics(servicename, props.globalTime);
|
||||||
|
props.getDbOverViewMetrics(servicename, props.globalTime);
|
||||||
}, [props.globalTime, servicename]);
|
}, [props.globalTime, servicename]);
|
||||||
|
|
||||||
const onTracePopupClick = (timestamp: number) => {
|
const onTracePopupClick = (timestamp: number) => {
|
||||||
@ -129,9 +134,9 @@ const _ServiceMetrics = (props: ServicesMetricsProps) => {
|
|||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Card bodyStyle={{ padding: 10 }}>
|
<Card bodyStyle={{ padding: 10 }}>
|
||||||
<ExternalApiGraph
|
<ExternalApiGraph
|
||||||
title=" External Call Error Rate"
|
title="External Call Error Percentage (%)"
|
||||||
keyIdentifier="externalHttpUrl"
|
keyIdentifier="externalHttpUrl"
|
||||||
dataIdentifier="numCalls"
|
dataIdentifier="errorRate"
|
||||||
data={props.externalErrCodeMetrics}
|
data={props.externalErrCodeMetrics}
|
||||||
/>
|
/>
|
||||||
</Card>
|
</Card>
|
||||||
@ -175,6 +180,33 @@ const _ServiceMetrics = (props: ServicesMetricsProps) => {
|
|||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
</TabPane>
|
</TabPane>
|
||||||
|
|
||||||
|
<TabPane tab="Database Calls" key="3">
|
||||||
|
<Row gutter={32} style={{ margin: 20 }}>
|
||||||
|
<Col span={12}>
|
||||||
|
<Card bodyStyle={{ padding: 10 }}>
|
||||||
|
<ExternalApiGraph
|
||||||
|
title="Database Calls RPS"
|
||||||
|
keyIdentifier="dbSystem"
|
||||||
|
dataIdentifier="callRate"
|
||||||
|
data={props.dbOverviewMetrics}
|
||||||
|
/>
|
||||||
|
</Card>
|
||||||
|
</Col>
|
||||||
|
|
||||||
|
<Col span={12}>
|
||||||
|
<Card bodyStyle={{ padding: 10 }}>
|
||||||
|
<ExternalApiGraph
|
||||||
|
label="Average Duration"
|
||||||
|
title="DataBase Calls Avg Duration"
|
||||||
|
dataIdentifier="avgDuration"
|
||||||
|
fnDataIdentifier={(s) => Number(s) / 1000000}
|
||||||
|
data={props.dbOverviewMetrics}
|
||||||
|
/>
|
||||||
|
</Card>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
</TabPane>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@ -187,6 +219,7 @@ const mapStateToProps = (
|
|||||||
externalAvgDurationMetrics: externalMetricsAvgDurationItem[];
|
externalAvgDurationMetrics: externalMetricsAvgDurationItem[];
|
||||||
externalErrCodeMetrics: externalErrCodeMetricsItem[];
|
externalErrCodeMetrics: externalErrCodeMetricsItem[];
|
||||||
externalMetrics: externalMetricsItem[];
|
externalMetrics: externalMetricsItem[];
|
||||||
|
dbOverviewMetrics: dbOverviewMetricsItem[];
|
||||||
globalTime: GlobalTime;
|
globalTime: GlobalTime;
|
||||||
} => {
|
} => {
|
||||||
return {
|
return {
|
||||||
@ -195,6 +228,7 @@ const mapStateToProps = (
|
|||||||
topEndpointsList: state.topEndpointsList,
|
topEndpointsList: state.topEndpointsList,
|
||||||
externalMetrics: state.externalMetrics,
|
externalMetrics: state.externalMetrics,
|
||||||
globalTime: state.globalTime,
|
globalTime: state.globalTime,
|
||||||
|
dbOverviewMetrics: state.dbOverviewMetrics,
|
||||||
externalAvgDurationMetrics: state.externalAvgDurationMetrics,
|
externalAvgDurationMetrics: state.externalAvgDurationMetrics,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -207,5 +241,6 @@ export const ServiceMetrics = withRouter(
|
|||||||
getExternalAvgDurationMetrics: getExternalAvgDurationMetrics,
|
getExternalAvgDurationMetrics: getExternalAvgDurationMetrics,
|
||||||
getTopEndpoints: getTopEndpoints,
|
getTopEndpoints: getTopEndpoints,
|
||||||
updateTimeInterval: updateTimeInterval,
|
updateTimeInterval: updateTimeInterval,
|
||||||
|
getDbOverViewMetrics: getDbOverViewMetrics,
|
||||||
})(_ServiceMetrics),
|
})(_ServiceMetrics),
|
||||||
);
|
);
|
||||||
|
@ -33,9 +33,9 @@ export interface externalMetricsAvgDurationItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface externalErrCodeMetricsItem {
|
export interface externalErrCodeMetricsItem {
|
||||||
callRate: number;
|
errorRate: number;
|
||||||
externalHttpUrl: string;
|
externalHttpUrl: string;
|
||||||
numCalls: number;
|
numErrors: number;
|
||||||
timestamp: number;
|
timestamp: number;
|
||||||
}
|
}
|
||||||
export interface topEndpointListItem {
|
export interface topEndpointListItem {
|
||||||
@ -54,6 +54,14 @@ export interface externalMetricsItem {
|
|||||||
timestamp: number;
|
timestamp: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface dbOverviewMetricsItem {
|
||||||
|
avgDuration: number;
|
||||||
|
callRate: number;
|
||||||
|
dbSystem: string;
|
||||||
|
numCalls: number;
|
||||||
|
timestamp: number;
|
||||||
|
}
|
||||||
|
|
||||||
export interface customMetricsItem {
|
export interface customMetricsItem {
|
||||||
timestamp: number;
|
timestamp: number;
|
||||||
value: number;
|
value: number;
|
||||||
@ -81,6 +89,10 @@ export interface getExternalMetricsAction {
|
|||||||
payload: externalMetricsItem[];
|
payload: externalMetricsItem[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface getDbOverViewMetricsAction {
|
||||||
|
type: ActionTypes.getDbOverviewMetrics;
|
||||||
|
payload: dbOverviewMetricsItem[];
|
||||||
|
}
|
||||||
export interface getTopEndpointsAction {
|
export interface getTopEndpointsAction {
|
||||||
type: ActionTypes.getTopEndpoints;
|
type: ActionTypes.getTopEndpoints;
|
||||||
payload: topEndpointListItem[];
|
payload: topEndpointListItem[];
|
||||||
@ -106,6 +118,29 @@ export const getServicesList = (globalTime: GlobalTime) => {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getDbOverViewMetrics = (
|
||||||
|
serviceName: string,
|
||||||
|
globalTime: GlobalTime,
|
||||||
|
) => {
|
||||||
|
return async (dispatch: Dispatch) => {
|
||||||
|
let request_string =
|
||||||
|
"/service/dbOverview?service=" +
|
||||||
|
serviceName +
|
||||||
|
"&start=" +
|
||||||
|
globalTime.minTime +
|
||||||
|
"&end=" +
|
||||||
|
globalTime.maxTime +
|
||||||
|
"&step=60";
|
||||||
|
const response = await api.get<dbOverviewMetricsItem[]>(
|
||||||
|
apiV1 + request_string,
|
||||||
|
);
|
||||||
|
dispatch<getDbOverViewMetricsAction>({
|
||||||
|
type: ActionTypes.getDbOverviewMetrics,
|
||||||
|
payload: response.data,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
export const getExternalMetrics = (
|
export const getExternalMetrics = (
|
||||||
serviceName: string,
|
serviceName: string,
|
||||||
globalTime: GlobalTime,
|
globalTime: GlobalTime,
|
||||||
|
@ -8,6 +8,7 @@ import {
|
|||||||
getExternalMetricsAction,
|
getExternalMetricsAction,
|
||||||
getTopEndpointsAction,
|
getTopEndpointsAction,
|
||||||
getFilteredTraceMetricsAction,
|
getFilteredTraceMetricsAction,
|
||||||
|
getDbOverViewMetricsAction,
|
||||||
} from "./metrics";
|
} from "./metrics";
|
||||||
import { getUsageDataAction } from "./usage";
|
import { getUsageDataAction } from "./usage";
|
||||||
import { updateTimeIntervalAction } from "./global";
|
import { updateTimeIntervalAction } from "./global";
|
||||||
@ -21,6 +22,7 @@ export enum ActionTypes {
|
|||||||
getServiceMetrics = "GET_SERVICE_METRICS",
|
getServiceMetrics = "GET_SERVICE_METRICS",
|
||||||
getAvgDurationMetrics = "GET_AVG_DURATION_METRICS",
|
getAvgDurationMetrics = "GET_AVG_DURATION_METRICS",
|
||||||
getErrCodeMetrics = "GET_ERR_CODE_METRICS",
|
getErrCodeMetrics = "GET_ERR_CODE_METRICS",
|
||||||
|
getDbOverviewMetrics = "GET_DB_OVERVIEW_METRICS",
|
||||||
getExternalMetrics = "GET_EXTERNAL_METRICS",
|
getExternalMetrics = "GET_EXTERNAL_METRICS",
|
||||||
getTopEndpoints = "GET_TOP_ENDPOINTS",
|
getTopEndpoints = "GET_TOP_ENDPOINTS",
|
||||||
getUsageData = "GET_USAGE_DATE",
|
getUsageData = "GET_USAGE_DATE",
|
||||||
@ -41,4 +43,5 @@ export type Action =
|
|||||||
| getFilteredTraceMetricsAction
|
| getFilteredTraceMetricsAction
|
||||||
| getExternalMetricsAction
|
| getExternalMetricsAction
|
||||||
| externalErrCodeMetricsActions
|
| externalErrCodeMetricsActions
|
||||||
|
| getDbOverViewMetricsAction
|
||||||
| externalMetricsAvgDurationAction;
|
| externalMetricsAvgDurationAction;
|
||||||
|
@ -20,6 +20,7 @@ import {
|
|||||||
externalErrCodeMetricsReducer,
|
externalErrCodeMetricsReducer,
|
||||||
serviceTableReducer,
|
serviceTableReducer,
|
||||||
topEndpointsReducer,
|
topEndpointsReducer,
|
||||||
|
dbOverviewMetricsReducer,
|
||||||
externalMetricsReducer,
|
externalMetricsReducer,
|
||||||
externalAvgDurationMetricsReducer,
|
externalAvgDurationMetricsReducer,
|
||||||
} from "./metrics";
|
} from "./metrics";
|
||||||
@ -36,6 +37,7 @@ export interface StoreState {
|
|||||||
serviceMetrics: metricItem[];
|
serviceMetrics: metricItem[];
|
||||||
topEndpointsList: topEndpointListItem[];
|
topEndpointsList: topEndpointListItem[];
|
||||||
externalMetrics: externalMetricsItem[];
|
externalMetrics: externalMetricsItem[];
|
||||||
|
dbOverviewMetrics: externalMetricsItem[];
|
||||||
externalAvgDurationMetrics: externalMetricsAvgDurationItem[];
|
externalAvgDurationMetrics: externalMetricsAvgDurationItem[];
|
||||||
externalErrCodeMetrics: externalErrCodeMetricsItem[];
|
externalErrCodeMetrics: externalErrCodeMetricsItem[];
|
||||||
usageDate: usageDataItem[];
|
usageDate: usageDataItem[];
|
||||||
@ -50,6 +52,7 @@ const reducers = combineReducers<StoreState>({
|
|||||||
traceItem: traceItemReducer,
|
traceItem: traceItemReducer,
|
||||||
servicesList: serviceTableReducer,
|
servicesList: serviceTableReducer,
|
||||||
serviceMetrics: serviceMetricsReducer,
|
serviceMetrics: serviceMetricsReducer,
|
||||||
|
dbOverviewMetrics: dbOverviewMetricsReducer,
|
||||||
topEndpointsList: topEndpointsReducer,
|
topEndpointsList: topEndpointsReducer,
|
||||||
externalAvgDurationMetrics: externalAvgDurationMetricsReducer,
|
externalAvgDurationMetrics: externalAvgDurationMetricsReducer,
|
||||||
externalMetrics: externalMetricsReducer,
|
externalMetrics: externalMetricsReducer,
|
||||||
|
@ -7,6 +7,7 @@ import {
|
|||||||
externalErrCodeMetricsItem,
|
externalErrCodeMetricsItem,
|
||||||
customMetricsItem,
|
customMetricsItem,
|
||||||
externalMetricsItem,
|
externalMetricsItem,
|
||||||
|
dbOverviewMetricsItem,
|
||||||
externalMetricsAvgDurationItem,
|
externalMetricsAvgDurationItem,
|
||||||
} from "../actions";
|
} from "../actions";
|
||||||
|
|
||||||
@ -125,6 +126,26 @@ export const externalMetricsReducer = (
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const dbOverviewMetricsReducer = (
|
||||||
|
state: dbOverviewMetricsItem[] = [
|
||||||
|
{
|
||||||
|
avgDuration: 0,
|
||||||
|
callRate: 0,
|
||||||
|
dbSystem: "",
|
||||||
|
numCalls: 0,
|
||||||
|
timestamp: 0,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
action: Action,
|
||||||
|
) => {
|
||||||
|
switch (action.type) {
|
||||||
|
case ActionTypes.getDbOverviewMetrics:
|
||||||
|
return action.payload;
|
||||||
|
default:
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
export const filteredTraceMetricsReducer = (
|
export const filteredTraceMetricsReducer = (
|
||||||
state: customMetricsItem[] = [{ timestamp: 0, value: 0 }],
|
state: customMetricsItem[] = [{ timestamp: 0, value: 0 }],
|
||||||
action: Action,
|
action: Action,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user