mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 20:59:02 +08:00
Merge branch 'develop' into 513-dashboard
This commit is contained in:
commit
2cffe0c53e
@ -102,6 +102,11 @@ export const AxiosAlertManagerInstance = axios.create({
|
|||||||
export const ApiV2Instance = axios.create({
|
export const ApiV2Instance = axios.create({
|
||||||
baseURL: `${ENVIRONMENT.baseURL}${apiV2}`,
|
baseURL: `${ENVIRONMENT.baseURL}${apiV2}`,
|
||||||
});
|
});
|
||||||
|
ApiV2Instance.interceptors.response.use(
|
||||||
|
interceptorsResponse,
|
||||||
|
interceptorRejected,
|
||||||
|
);
|
||||||
|
ApiV2Instance.interceptors.request.use(interceptorsRequestResponse);
|
||||||
|
|
||||||
AxiosAlertManagerInstance.interceptors.response.use(
|
AxiosAlertManagerInstance.interceptors.response.use(
|
||||||
interceptorsResponse,
|
interceptorsResponse,
|
||||||
|
@ -7,17 +7,13 @@ export const getYAxisFormattedValue = (
|
|||||||
let decimalPrecision: number | undefined;
|
let decimalPrecision: number | undefined;
|
||||||
const parsedValue = getValueFormat(format)(
|
const parsedValue = getValueFormat(format)(
|
||||||
parseFloat(value),
|
parseFloat(value),
|
||||||
12,
|
undefined,
|
||||||
12,
|
undefined,
|
||||||
undefined,
|
undefined,
|
||||||
);
|
);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const decimalSplitted = parsedValue.text.split('.');
|
const decimalSplitted = parsedValue.text.split('.');
|
||||||
if (
|
if (decimalSplitted.length === 1) {
|
||||||
decimalSplitted.length === 1 ||
|
|
||||||
parseFloat(parsedValue.text) === parseInt(parsedValue.text, 10)
|
|
||||||
) {
|
|
||||||
decimalPrecision = 0;
|
decimalPrecision = 0;
|
||||||
} else {
|
} else {
|
||||||
const decimalDigits = decimalSplitted[1].split('');
|
const decimalDigits = decimalSplitted[1].split('');
|
||||||
|
@ -143,17 +143,23 @@ export async function GetMetricQueryRange({
|
|||||||
`API responded with ${response.statusCode} - ${response.error}`,
|
`API responded with ${response.statusCode} - ${response.error}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (response.payload?.data?.result) {
|
if (response.payload?.data?.result) {
|
||||||
response.payload.data.result = response.payload.data.result.map(
|
response.payload.data.result = response.payload.data.result.map(
|
||||||
(queryData) => {
|
(queryData) => {
|
||||||
const newQueryData = queryData;
|
const newQueryData = queryData;
|
||||||
newQueryData.legend = legendMap[queryData.queryName];
|
newQueryData.legend = legendMap[queryData.queryName]; // Adds the legend if it is already defined by the user.
|
||||||
|
// If metric names is an empty object
|
||||||
if (isEmpty(queryData.metric)) {
|
if (isEmpty(queryData.metric)) {
|
||||||
newQueryData.metric[queryData.queryName] = queryData.queryName;
|
// If metrics list is empty && the user haven't defined a legend then add the legend equal to the name of the query.
|
||||||
|
if (!newQueryData.legend) {
|
||||||
newQueryData.legend = queryData.queryName;
|
newQueryData.legend = queryData.queryName;
|
||||||
}
|
}
|
||||||
return queryData;
|
// If name of the query and the legend if inserted is same then add the same to the metrics object.
|
||||||
|
if (queryData.queryName === newQueryData.legend) {
|
||||||
|
newQueryData.metric[queryData.queryName] = queryData.queryName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return newQueryData;
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user