mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-18 03:45:56 +08:00
commit
0bebd3e338
@ -146,7 +146,7 @@ services:
|
|||||||
condition: on-failure
|
condition: on-failure
|
||||||
|
|
||||||
query-service:
|
query-service:
|
||||||
image: signoz/query-service:0.38.1
|
image: signoz/query-service:0.38.2
|
||||||
command:
|
command:
|
||||||
[
|
[
|
||||||
"-config=/root/config/prometheus.yml",
|
"-config=/root/config/prometheus.yml",
|
||||||
@ -186,7 +186,7 @@ services:
|
|||||||
<<: *db-depend
|
<<: *db-depend
|
||||||
|
|
||||||
frontend:
|
frontend:
|
||||||
image: signoz/frontend:0.38.1
|
image: signoz/frontend:0.38.2
|
||||||
deploy:
|
deploy:
|
||||||
restart_policy:
|
restart_policy:
|
||||||
condition: on-failure
|
condition: on-failure
|
||||||
@ -199,7 +199,7 @@ services:
|
|||||||
- ../common/nginx-config.conf:/etc/nginx/conf.d/default.conf
|
- ../common/nginx-config.conf:/etc/nginx/conf.d/default.conf
|
||||||
|
|
||||||
otel-collector:
|
otel-collector:
|
||||||
image: signoz/signoz-otel-collector:0.88.9
|
image: signoz/signoz-otel-collector:0.88.11
|
||||||
command:
|
command:
|
||||||
[
|
[
|
||||||
"--config=/etc/otel-collector-config.yaml",
|
"--config=/etc/otel-collector-config.yaml",
|
||||||
@ -237,7 +237,7 @@ services:
|
|||||||
- query-service
|
- query-service
|
||||||
|
|
||||||
otel-collector-migrator:
|
otel-collector-migrator:
|
||||||
image: signoz/signoz-schema-migrator:0.88.9
|
image: signoz/signoz-schema-migrator:0.88.11
|
||||||
deploy:
|
deploy:
|
||||||
restart_policy:
|
restart_policy:
|
||||||
condition: on-failure
|
condition: on-failure
|
||||||
|
@ -66,7 +66,7 @@ services:
|
|||||||
- --storage.path=/data
|
- --storage.path=/data
|
||||||
|
|
||||||
otel-collector-migrator:
|
otel-collector-migrator:
|
||||||
image: signoz/signoz-schema-migrator:${OTELCOL_TAG:-0.88.9}
|
image: signoz/signoz-schema-migrator:${OTELCOL_TAG:-0.88.11}
|
||||||
container_name: otel-migrator
|
container_name: otel-migrator
|
||||||
command:
|
command:
|
||||||
- "--dsn=tcp://clickhouse:9000"
|
- "--dsn=tcp://clickhouse:9000"
|
||||||
@ -81,7 +81,7 @@ services:
|
|||||||
# Notes for Maintainers/Contributors who will change Line Numbers of Frontend & Query-Section. Please Update Line Numbers in `./scripts/commentLinesForSetup.sh` & `./CONTRIBUTING.md`
|
# Notes for Maintainers/Contributors who will change Line Numbers of Frontend & Query-Section. Please Update Line Numbers in `./scripts/commentLinesForSetup.sh` & `./CONTRIBUTING.md`
|
||||||
otel-collector:
|
otel-collector:
|
||||||
container_name: signoz-otel-collector
|
container_name: signoz-otel-collector
|
||||||
image: signoz/signoz-otel-collector:0.88.9
|
image: signoz/signoz-otel-collector:0.88.11
|
||||||
command:
|
command:
|
||||||
[
|
[
|
||||||
"--config=/etc/otel-collector-config.yaml",
|
"--config=/etc/otel-collector-config.yaml",
|
||||||
|
@ -164,7 +164,7 @@ services:
|
|||||||
# Notes for Maintainers/Contributors who will change Line Numbers of Frontend & Query-Section. Please Update Line Numbers in `./scripts/commentLinesForSetup.sh` & `./CONTRIBUTING.md`
|
# Notes for Maintainers/Contributors who will change Line Numbers of Frontend & Query-Section. Please Update Line Numbers in `./scripts/commentLinesForSetup.sh` & `./CONTRIBUTING.md`
|
||||||
|
|
||||||
query-service:
|
query-service:
|
||||||
image: signoz/query-service:${DOCKER_TAG:-0.38.1}
|
image: signoz/query-service:${DOCKER_TAG:-0.38.2}
|
||||||
container_name: signoz-query-service
|
container_name: signoz-query-service
|
||||||
command:
|
command:
|
||||||
[
|
[
|
||||||
@ -203,7 +203,7 @@ services:
|
|||||||
<<: *db-depend
|
<<: *db-depend
|
||||||
|
|
||||||
frontend:
|
frontend:
|
||||||
image: signoz/frontend:${DOCKER_TAG:-0.38.1}
|
image: signoz/frontend:${DOCKER_TAG:-0.38.2}
|
||||||
container_name: signoz-frontend
|
container_name: signoz-frontend
|
||||||
restart: on-failure
|
restart: on-failure
|
||||||
depends_on:
|
depends_on:
|
||||||
@ -215,7 +215,7 @@ services:
|
|||||||
- ../common/nginx-config.conf:/etc/nginx/conf.d/default.conf
|
- ../common/nginx-config.conf:/etc/nginx/conf.d/default.conf
|
||||||
|
|
||||||
otel-collector-migrator:
|
otel-collector-migrator:
|
||||||
image: signoz/signoz-schema-migrator:${OTELCOL_TAG:-0.88.9}
|
image: signoz/signoz-schema-migrator:${OTELCOL_TAG:-0.88.11}
|
||||||
container_name: otel-migrator
|
container_name: otel-migrator
|
||||||
command:
|
command:
|
||||||
- "--dsn=tcp://clickhouse:9000"
|
- "--dsn=tcp://clickhouse:9000"
|
||||||
@ -229,7 +229,7 @@ services:
|
|||||||
|
|
||||||
|
|
||||||
otel-collector:
|
otel-collector:
|
||||||
image: signoz/signoz-otel-collector:${OTELCOL_TAG:-0.88.9}
|
image: signoz/signoz-otel-collector:${OTELCOL_TAG:-0.88.11}
|
||||||
container_name: signoz-otel-collector
|
container_name: signoz-otel-collector
|
||||||
command:
|
command:
|
||||||
[
|
[
|
||||||
|
@ -210,7 +210,8 @@
|
|||||||
},
|
},
|
||||||
"lint-staged": {
|
"lint-staged": {
|
||||||
"*.(js|jsx|ts|tsx)": [
|
"*.(js|jsx|ts|tsx)": [
|
||||||
"eslint --fix"
|
"eslint --fix",
|
||||||
|
"sh scripts/typecheck-staged.sh"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
|
25
frontend/scripts/typecheck-staged.sh
Normal file
25
frontend/scripts/typecheck-staged.sh
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
files="";
|
||||||
|
|
||||||
|
# lint-staged will pass all files in $1 $2 $3 etc. iterate and concat.
|
||||||
|
for var in "$@"
|
||||||
|
do
|
||||||
|
files="$files \"$var\","
|
||||||
|
done
|
||||||
|
|
||||||
|
# create temporary tsconfig which includes only passed files
|
||||||
|
str="{
|
||||||
|
\"extends\": \"./tsconfig.json\",
|
||||||
|
\"include\": [\"src/types/global.d.ts\",\"src/typings/window.ts\", $files]
|
||||||
|
}"
|
||||||
|
echo $str > tsconfig.tmp
|
||||||
|
|
||||||
|
# run typecheck using temp config
|
||||||
|
tsc -p ./tsconfig.tmp
|
||||||
|
|
||||||
|
# capture exit code of tsc
|
||||||
|
code=$?
|
||||||
|
|
||||||
|
# delete temp config
|
||||||
|
rm ./tsconfig.tmp
|
||||||
|
|
||||||
|
exit $code
|
@ -73,19 +73,12 @@ function ResizeTable({
|
|||||||
}
|
}
|
||||||
}, [columns]);
|
}, [columns]);
|
||||||
|
|
||||||
const paginationConfig = {
|
|
||||||
hideOnSinglePage: true,
|
|
||||||
showTotal: (total: number, range: number[]): string =>
|
|
||||||
`${range[0]}-${range[1]} of ${total} items`,
|
|
||||||
...tableParams.pagination,
|
|
||||||
};
|
|
||||||
|
|
||||||
return onDragColumn ? (
|
return onDragColumn ? (
|
||||||
<ReactDragListView.DragColumn {...dragColumnParams} onDragEnd={onDragColumn}>
|
<ReactDragListView.DragColumn {...dragColumnParams} onDragEnd={onDragColumn}>
|
||||||
<Table {...tableParams} pagination={paginationConfig} />
|
<Table {...tableParams} />
|
||||||
</ReactDragListView.DragColumn>
|
</ReactDragListView.DragColumn>
|
||||||
) : (
|
) : (
|
||||||
<Table {...tableParams} pagination={paginationConfig} />
|
<Table {...tableParams} />
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
.general-settings-container {
|
||||||
|
.ant-card-body {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 16px;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
import './GeneralSettingsCloud.styles.scss';
|
||||||
|
|
||||||
|
import { Card, Typography } from 'antd';
|
||||||
|
import { Info } from 'lucide-react';
|
||||||
|
|
||||||
|
export default function GeneralSettingsCloud(): JSX.Element {
|
||||||
|
return (
|
||||||
|
<Card className="general-settings-container">
|
||||||
|
<Info size={16} />
|
||||||
|
<Typography.Text>
|
||||||
|
Please <a href="mailto:cloud-support@signoz.io"> email us </a> or connect
|
||||||
|
with us via intercom support to change the retention period.
|
||||||
|
</Typography.Text>
|
||||||
|
</Card>
|
||||||
|
);
|
||||||
|
}
|
3
frontend/src/container/GeneralSettingsCloud/index.tsx
Normal file
3
frontend/src/container/GeneralSettingsCloud/index.tsx
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
import GeneralSettingsCloud from './GeneralSettingsCloud';
|
||||||
|
|
||||||
|
export default GeneralSettingsCloud;
|
@ -91,6 +91,11 @@ function ServiceMetricTable({
|
|||||||
<ResourceAttributesFilter />
|
<ResourceAttributesFilter />
|
||||||
|
|
||||||
<ResizeTable
|
<ResizeTable
|
||||||
|
pagination={{
|
||||||
|
defaultPageSize: 10,
|
||||||
|
showTotal: (total: number, range: number[]): string =>
|
||||||
|
`${range[0]}-${range[1]} of ${total} items`,
|
||||||
|
}}
|
||||||
columns={tableColumns}
|
columns={tableColumns}
|
||||||
loading={isLoading}
|
loading={isLoading}
|
||||||
dataSource={services}
|
dataSource={services}
|
||||||
|
@ -49,6 +49,11 @@ function ServiceTraceTable({
|
|||||||
<ResourceAttributesFilter />
|
<ResourceAttributesFilter />
|
||||||
|
|
||||||
<ResizeTable
|
<ResizeTable
|
||||||
|
pagination={{
|
||||||
|
defaultPageSize: 10,
|
||||||
|
showTotal: (total: number, range: number[]): string =>
|
||||||
|
`${range[0]}-${range[1]} of ${total} items`,
|
||||||
|
}}
|
||||||
columns={tableColumns}
|
columns={tableColumns}
|
||||||
loading={loading}
|
loading={loading}
|
||||||
dataSource={services}
|
dataSource={services}
|
||||||
|
@ -253,6 +253,15 @@ function SideNav({
|
|||||||
}
|
}
|
||||||
}, [isCloudUserVal, isEnterprise, isFetching]);
|
}, [isCloudUserVal, isEnterprise, isFetching]);
|
||||||
|
|
||||||
|
const [isCurrentOrgSettings] = useComponentPermission(
|
||||||
|
['current_org_settings'],
|
||||||
|
role,
|
||||||
|
);
|
||||||
|
|
||||||
|
const settingsRoute = isCurrentOrgSettings
|
||||||
|
? ROUTES.ORG_SETTINGS
|
||||||
|
: ROUTES.SETTINGS;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={cx('sideNav', collapsed ? 'collapsed' : '')}>
|
<div className={cx('sideNav', collapsed ? 'collapsed' : '')}>
|
||||||
<div className="brand">
|
<div className="brand">
|
||||||
@ -302,7 +311,9 @@ function SideNav({
|
|||||||
item={item}
|
item={item}
|
||||||
isActive={activeMenuKey === item.key}
|
isActive={activeMenuKey === item.key}
|
||||||
onClick={(): void => {
|
onClick={(): void => {
|
||||||
if (item) {
|
if (item.key === ROUTES.SETTINGS) {
|
||||||
|
history.push(settingsRoute);
|
||||||
|
} else if (item) {
|
||||||
onClickHandler(item?.key as string);
|
onClickHandler(item?.key as string);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
@ -96,3 +96,13 @@ export const routesToSkip = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
export const routesToDisable = [ROUTES.LOGS_EXPLORER, ROUTES.LIVE_LOGS];
|
export const routesToDisable = [ROUTES.LOGS_EXPLORER, ROUTES.LIVE_LOGS];
|
||||||
|
|
||||||
|
export interface LocalStorageTimeRange {
|
||||||
|
localstorageStartTime: string | null;
|
||||||
|
localstorageEndTime: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface TimeRange {
|
||||||
|
startTime: string;
|
||||||
|
endTime: string;
|
||||||
|
}
|
||||||
|
@ -15,6 +15,7 @@ import useUrlQuery from 'hooks/useUrlQuery';
|
|||||||
import GetMinMax from 'lib/getMinMax';
|
import GetMinMax from 'lib/getMinMax';
|
||||||
import getTimeString from 'lib/getTimeString';
|
import getTimeString from 'lib/getTimeString';
|
||||||
import history from 'lib/history';
|
import history from 'lib/history';
|
||||||
|
import { isObject } from 'lodash-es';
|
||||||
import { useCallback, useEffect, useMemo, useState } from 'react';
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
||||||
import { connect, useSelector } from 'react-redux';
|
import { connect, useSelector } from 'react-redux';
|
||||||
import { RouteComponentProps, withRouter } from 'react-router-dom';
|
import { RouteComponentProps, withRouter } from 'react-router-dom';
|
||||||
@ -27,7 +28,13 @@ import { GlobalReducer } from 'types/reducer/globalTime';
|
|||||||
|
|
||||||
import AutoRefresh from '../AutoRefresh';
|
import AutoRefresh from '../AutoRefresh';
|
||||||
import CustomDateTimeModal, { DateTimeRangeType } from '../CustomDateTimeModal';
|
import CustomDateTimeModal, { DateTimeRangeType } from '../CustomDateTimeModal';
|
||||||
import { getDefaultOption, getOptions, Time } from './config';
|
import {
|
||||||
|
getDefaultOption,
|
||||||
|
getOptions,
|
||||||
|
LocalStorageTimeRange,
|
||||||
|
Time,
|
||||||
|
TimeRange,
|
||||||
|
} from './config';
|
||||||
import RefreshText from './Refresh';
|
import RefreshText from './Refresh';
|
||||||
import { Form, FormContainer, FormItem } from './styles';
|
import { Form, FormContainer, FormItem } from './styles';
|
||||||
|
|
||||||
@ -44,8 +51,35 @@ function DateTimeSelection({
|
|||||||
const searchStartTime = urlQuery.get('startTime');
|
const searchStartTime = urlQuery.get('startTime');
|
||||||
const searchEndTime = urlQuery.get('endTime');
|
const searchEndTime = urlQuery.get('endTime');
|
||||||
|
|
||||||
const localstorageStartTime = getLocalStorageKey('startTime');
|
const {
|
||||||
const localstorageEndTime = getLocalStorageKey('endTime');
|
localstorageStartTime,
|
||||||
|
localstorageEndTime,
|
||||||
|
} = ((): LocalStorageTimeRange => {
|
||||||
|
const routes = getLocalStorageKey(LOCALSTORAGE.METRICS_TIME_IN_DURATION);
|
||||||
|
|
||||||
|
if (routes !== null) {
|
||||||
|
const routesObject = JSON.parse(routes || '{}');
|
||||||
|
const selectedTime = routesObject[location.pathname];
|
||||||
|
|
||||||
|
if (selectedTime) {
|
||||||
|
let parsedSelectedTime: TimeRange;
|
||||||
|
try {
|
||||||
|
parsedSelectedTime = JSON.parse(selectedTime);
|
||||||
|
} catch {
|
||||||
|
parsedSelectedTime = selectedTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isObject(parsedSelectedTime)) {
|
||||||
|
return {
|
||||||
|
localstorageStartTime: parsedSelectedTime.startTime,
|
||||||
|
localstorageEndTime: parsedSelectedTime.endTime,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return { localstorageStartTime: null, localstorageEndTime: null };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return { localstorageStartTime: null, localstorageEndTime: null };
|
||||||
|
})();
|
||||||
|
|
||||||
const getTime = useCallback((): [number, number] | undefined => {
|
const getTime = useCallback((): [number, number] | undefined => {
|
||||||
if (searchEndTime && searchStartTime) {
|
if (searchEndTime && searchStartTime) {
|
||||||
@ -118,6 +152,15 @@ function DateTimeSelection({
|
|||||||
const selectedTime = routesObject[pathName];
|
const selectedTime = routesObject[pathName];
|
||||||
|
|
||||||
if (selectedTime) {
|
if (selectedTime) {
|
||||||
|
let parsedSelectedTime: TimeRange;
|
||||||
|
try {
|
||||||
|
parsedSelectedTime = JSON.parse(selectedTime);
|
||||||
|
} catch {
|
||||||
|
parsedSelectedTime = selectedTime;
|
||||||
|
}
|
||||||
|
if (isObject(parsedSelectedTime)) {
|
||||||
|
return 'custom';
|
||||||
|
}
|
||||||
return selectedTime;
|
return selectedTime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -125,7 +168,7 @@ function DateTimeSelection({
|
|||||||
return defaultSelectedOption;
|
return defaultSelectedOption;
|
||||||
};
|
};
|
||||||
|
|
||||||
const updateLocalStorageForRoutes = (value: Time): void => {
|
const updateLocalStorageForRoutes = (value: Time | string): void => {
|
||||||
const preRoutes = getLocalStorageKey(LOCALSTORAGE.METRICS_TIME_IN_DURATION);
|
const preRoutes = getLocalStorageKey(LOCALSTORAGE.METRICS_TIME_IN_DURATION);
|
||||||
if (preRoutes !== null) {
|
if (preRoutes !== null) {
|
||||||
const preRoutesObject = JSON.parse(preRoutes);
|
const preRoutesObject = JSON.parse(preRoutes);
|
||||||
@ -220,9 +263,9 @@ function DateTimeSelection({
|
|||||||
startTimeMoment?.toDate().getTime() || 0,
|
startTimeMoment?.toDate().getTime() || 0,
|
||||||
endTimeMoment?.toDate().getTime() || 0,
|
endTimeMoment?.toDate().getTime() || 0,
|
||||||
]);
|
]);
|
||||||
setLocalStorageKey('startTime', startTimeMoment.toString());
|
updateLocalStorageForRoutes(
|
||||||
setLocalStorageKey('endTime', endTimeMoment.toString());
|
JSON.stringify({ startTime: startTimeMoment, endTime: endTimeMoment }),
|
||||||
updateLocalStorageForRoutes('custom');
|
);
|
||||||
if (!isLogsExplorerPage) {
|
if (!isLogsExplorerPage) {
|
||||||
urlQuery.set(
|
urlQuery.set(
|
||||||
QueryParams.startTime,
|
QueryParams.startTime,
|
||||||
|
@ -88,9 +88,11 @@ const getChartData = ({
|
|||||||
const allLabels = modifiedData.map((e) => e.label);
|
const allLabels = modifiedData.map((e) => e.label);
|
||||||
|
|
||||||
const updatedDataSet = updatedSortedData.map((e, index) => {
|
const updatedDataSet = updatedSortedData.map((e, index) => {
|
||||||
|
const label = allLabels[index];
|
||||||
|
|
||||||
const datasetBaseConfig = {
|
const datasetBaseConfig = {
|
||||||
index,
|
index,
|
||||||
label: allLabels[index],
|
label,
|
||||||
borderColor: colors[index % colors.length] || 'red',
|
borderColor: colors[index % colors.length] || 'red',
|
||||||
data: e.second,
|
data: e.second,
|
||||||
borderWidth: 1.5,
|
borderWidth: 1.5,
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
import { getToolTipValue } from 'components/Graph/yAxisConfig';
|
import { getToolTipValue } from 'components/Graph/yAxisConfig';
|
||||||
|
import { themeColors } from 'constants/theme';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import customParseFormat from 'dayjs/plugin/customParseFormat';
|
import customParseFormat from 'dayjs/plugin/customParseFormat';
|
||||||
import getLabelName from 'lib/getLabelName';
|
import getLabelName from 'lib/getLabelName';
|
||||||
import { MetricRangePayloadProps } from 'types/api/metrics/getQueryRange';
|
import { MetricRangePayloadProps } from 'types/api/metrics/getQueryRange';
|
||||||
|
|
||||||
import { colors } from '../../getRandomColor';
|
|
||||||
import { placement } from '../placement';
|
import { placement } from '../placement';
|
||||||
|
import { generateColor } from '../utils/generateColor';
|
||||||
|
|
||||||
dayjs.extend(customParseFormat);
|
dayjs.extend(customParseFormat);
|
||||||
|
|
||||||
@ -54,12 +55,14 @@ const generateTooltipContent = (
|
|||||||
const value = data[index][idx];
|
const value = data[index][idx];
|
||||||
const label = getLabelName(metric, queryName || '', legend || '');
|
const label = getLabelName(metric, queryName || '', legend || '');
|
||||||
|
|
||||||
|
const color = generateColor(label, themeColors.chartcolors);
|
||||||
|
|
||||||
if (Number.isFinite(value)) {
|
if (Number.isFinite(value)) {
|
||||||
const tooltipValue = getToolTipValue(value, yAxisUnit);
|
const tooltipValue = getToolTipValue(value, yAxisUnit);
|
||||||
|
|
||||||
const dataObj = {
|
const dataObj = {
|
||||||
show: item.show || false,
|
show: item.show || false,
|
||||||
color: colors[(index - 1) % colors.length],
|
color,
|
||||||
label,
|
label,
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
20
frontend/src/lib/uPlotLib/utils/generateColor.ts
Normal file
20
frontend/src/lib/uPlotLib/utils/generateColor.ts
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
/* eslint-disable no-bitwise */
|
||||||
|
export function hashFn(str: string): number {
|
||||||
|
let hash = 5381;
|
||||||
|
for (let i = 0; i < str.length; i++) {
|
||||||
|
hash = (hash * 33) ^ str.charCodeAt(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
return hash >>> 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function generateColor(
|
||||||
|
key: string,
|
||||||
|
colorMap: Record<string, string>,
|
||||||
|
): string {
|
||||||
|
const hashValue = hashFn(key);
|
||||||
|
const keys = Object.keys(colorMap);
|
||||||
|
const colorIndex = hashValue % keys.length;
|
||||||
|
const selectedKey = keys[colorIndex];
|
||||||
|
return colorMap[selectedKey];
|
||||||
|
}
|
@ -1,8 +1,9 @@
|
|||||||
|
import { themeColors } from 'constants/theme';
|
||||||
import getLabelName from 'lib/getLabelName';
|
import getLabelName from 'lib/getLabelName';
|
||||||
import { colors } from 'lib/getRandomColor';
|
|
||||||
import { MetricRangePayloadProps } from 'types/api/metrics/getQueryRange';
|
import { MetricRangePayloadProps } from 'types/api/metrics/getQueryRange';
|
||||||
import { QueryData } from 'types/api/widgets/getQuery';
|
import { QueryData } from 'types/api/widgets/getQuery';
|
||||||
|
|
||||||
|
import { generateColor } from './generateColor';
|
||||||
import getRenderer, { drawStyles, lineInterpolations } from './getRenderer';
|
import getRenderer, { drawStyles, lineInterpolations } from './getRenderer';
|
||||||
|
|
||||||
const paths = (
|
const paths = (
|
||||||
@ -36,8 +37,6 @@ const getSeries = (
|
|||||||
const newGraphVisibilityStates = graphsVisibilityStates?.slice(1);
|
const newGraphVisibilityStates = graphsVisibilityStates?.slice(1);
|
||||||
|
|
||||||
for (let i = 0; i < seriesList?.length; i += 1) {
|
for (let i = 0; i < seriesList?.length; i += 1) {
|
||||||
const color = colors[i % colors.length]; // Use modulo to loop through colors if there are more series than colors
|
|
||||||
|
|
||||||
const { metric = {}, queryName = '', legend = '' } = widgetMetaData[i] || {};
|
const { metric = {}, queryName = '', legend = '' } = widgetMetaData[i] || {};
|
||||||
|
|
||||||
const label = getLabelName(
|
const label = getLabelName(
|
||||||
@ -46,6 +45,8 @@ const getSeries = (
|
|||||||
legend || '',
|
legend || '',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const color = generateColor(label, themeColors.chartcolors);
|
||||||
|
|
||||||
const pointSize = seriesList[i].values.length > 1 ? 5 : 10;
|
const pointSize = seriesList[i].values.length > 1 ? 5 : 10;
|
||||||
const showPoints = !(seriesList[i].values.length > 1);
|
const showPoints = !(seriesList[i].values.length > 1);
|
||||||
|
|
||||||
|
@ -2,17 +2,21 @@ import { RouteTabProps } from 'components/RouteTab/types';
|
|||||||
import ROUTES from 'constants/routes';
|
import ROUTES from 'constants/routes';
|
||||||
import AlertChannels from 'container/AllAlertChannels';
|
import AlertChannels from 'container/AllAlertChannels';
|
||||||
import GeneralSettings from 'container/GeneralSettings';
|
import GeneralSettings from 'container/GeneralSettings';
|
||||||
|
import GeneralSettingsCloud from 'container/GeneralSettingsCloud';
|
||||||
import IngestionSettings from 'container/IngestionSettings/IngestionSettings';
|
import IngestionSettings from 'container/IngestionSettings/IngestionSettings';
|
||||||
import OrganizationSettings from 'container/OrganizationSettings';
|
import OrganizationSettings from 'container/OrganizationSettings';
|
||||||
import { TFunction } from 'i18next';
|
import { TFunction } from 'i18next';
|
||||||
|
|
||||||
export const commonRoutes = (t: TFunction): RouteTabProps['routes'] => [
|
export const organizationSettings = (t: TFunction): RouteTabProps['routes'] => [
|
||||||
{
|
{
|
||||||
Component: GeneralSettings,
|
Component: OrganizationSettings,
|
||||||
name: t('routes:general').toString(),
|
name: t('routes:organization_settings').toString(),
|
||||||
route: ROUTES.SETTINGS,
|
route: ROUTES.ORG_SETTINGS,
|
||||||
key: ROUTES.SETTINGS,
|
key: ROUTES.ORG_SETTINGS,
|
||||||
},
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export const alertChannels = (t: TFunction): RouteTabProps['routes'] => [
|
||||||
{
|
{
|
||||||
Component: AlertChannels,
|
Component: AlertChannels,
|
||||||
name: t('routes:alert_channels').toString(),
|
name: t('routes:alert_channels').toString(),
|
||||||
@ -30,11 +34,20 @@ export const ingestionSettings = (t: TFunction): RouteTabProps['routes'] => [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export const organizationSettings = (t: TFunction): RouteTabProps['routes'] => [
|
export const generalSettings = (t: TFunction): RouteTabProps['routes'] => [
|
||||||
{
|
{
|
||||||
Component: OrganizationSettings,
|
Component: GeneralSettings,
|
||||||
name: t('routes:organization_settings').toString(),
|
name: t('routes:general').toString(),
|
||||||
route: ROUTES.ORG_SETTINGS,
|
route: ROUTES.SETTINGS,
|
||||||
key: ROUTES.ORG_SETTINGS,
|
key: ROUTES.SETTINGS,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export const generalSettingsCloud = (t: TFunction): RouteTabProps['routes'] => [
|
||||||
|
{
|
||||||
|
Component: GeneralSettingsCloud,
|
||||||
|
name: t('routes:general').toString(),
|
||||||
|
route: ROUTES.SETTINGS,
|
||||||
|
key: ROUTES.SETTINGS,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
@ -3,7 +3,9 @@ import { TFunction } from 'i18next';
|
|||||||
import { isCloudUser } from 'utils/app';
|
import { isCloudUser } from 'utils/app';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
commonRoutes,
|
alertChannels,
|
||||||
|
generalSettings,
|
||||||
|
generalSettingsCloud,
|
||||||
ingestionSettings,
|
ingestionSettings,
|
||||||
organizationSettings,
|
organizationSettings,
|
||||||
} from './config';
|
} from './config';
|
||||||
@ -12,15 +14,20 @@ export const getRoutes = (
|
|||||||
isCurrentOrgSettings: boolean,
|
isCurrentOrgSettings: boolean,
|
||||||
t: TFunction,
|
t: TFunction,
|
||||||
): RouteTabProps['routes'] => {
|
): RouteTabProps['routes'] => {
|
||||||
let common = commonRoutes(t);
|
const settings = [];
|
||||||
|
|
||||||
if (isCurrentOrgSettings) {
|
if (isCurrentOrgSettings) {
|
||||||
common = [...common, ...organizationSettings(t)];
|
settings.push(...organizationSettings(t));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isCloudUser()) {
|
if (isCloudUser()) {
|
||||||
common = [...common, ...ingestionSettings(t)];
|
settings.push(...ingestionSettings(t));
|
||||||
|
settings.push(...alertChannels(t));
|
||||||
|
settings.push(...generalSettingsCloud(t));
|
||||||
|
} else {
|
||||||
|
settings.push(...alertChannels(t));
|
||||||
|
settings.push(...generalSettings(t));
|
||||||
}
|
}
|
||||||
|
|
||||||
return common;
|
return settings;
|
||||||
};
|
};
|
||||||
|
2
go.mod
2
go.mod
@ -5,7 +5,7 @@ go 1.21
|
|||||||
require (
|
require (
|
||||||
github.com/ClickHouse/clickhouse-go/v2 v2.15.0
|
github.com/ClickHouse/clickhouse-go/v2 v2.15.0
|
||||||
github.com/SigNoz/govaluate v0.0.0-20220522085550-d19c08c206cb
|
github.com/SigNoz/govaluate v0.0.0-20220522085550-d19c08c206cb
|
||||||
github.com/SigNoz/signoz-otel-collector v0.88.9
|
github.com/SigNoz/signoz-otel-collector v0.88.11
|
||||||
github.com/SigNoz/zap_otlp/zap_otlp_encoder v0.0.0-20230822164844-1b861a431974
|
github.com/SigNoz/zap_otlp/zap_otlp_encoder v0.0.0-20230822164844-1b861a431974
|
||||||
github.com/SigNoz/zap_otlp/zap_otlp_sync v0.0.0-20230822164844-1b861a431974
|
github.com/SigNoz/zap_otlp/zap_otlp_sync v0.0.0-20230822164844-1b861a431974
|
||||||
github.com/antonmedv/expr v1.15.3
|
github.com/antonmedv/expr v1.15.3
|
||||||
|
4
go.sum
4
go.sum
@ -98,8 +98,8 @@ github.com/SigNoz/govaluate v0.0.0-20220522085550-d19c08c206cb h1:bneLSKPf9YUSFm
|
|||||||
github.com/SigNoz/govaluate v0.0.0-20220522085550-d19c08c206cb/go.mod h1:JznGDNg9x1cujDKa22RaQOimOvvEfy3nxzDGd8XDgmA=
|
github.com/SigNoz/govaluate v0.0.0-20220522085550-d19c08c206cb/go.mod h1:JznGDNg9x1cujDKa22RaQOimOvvEfy3nxzDGd8XDgmA=
|
||||||
github.com/SigNoz/prometheus v1.9.78 h1:bB3yuDrRzi/Mv00kWayR9DZbyjTuGfendSqISyDcXiY=
|
github.com/SigNoz/prometheus v1.9.78 h1:bB3yuDrRzi/Mv00kWayR9DZbyjTuGfendSqISyDcXiY=
|
||||||
github.com/SigNoz/prometheus v1.9.78/go.mod h1:MffmFu2qFILQrOHehx3D0XjYtaZMVfI+Ppeiv98x4Ww=
|
github.com/SigNoz/prometheus v1.9.78/go.mod h1:MffmFu2qFILQrOHehx3D0XjYtaZMVfI+Ppeiv98x4Ww=
|
||||||
github.com/SigNoz/signoz-otel-collector v0.88.9 h1:7bbJSXrSZcQsdEVVLsjsNXm/bWe9MhKu8qfXp8MlXQM=
|
github.com/SigNoz/signoz-otel-collector v0.88.11 h1:w9IVcXg5T+o37c0HVtBfxdKxkPYyiGX1YaOrCexpjrc=
|
||||||
github.com/SigNoz/signoz-otel-collector v0.88.9/go.mod h1:7I4FWwraVSnDywsPNbo8TdHDsPxShtYkGU5usr6dTtk=
|
github.com/SigNoz/signoz-otel-collector v0.88.11/go.mod h1:2ddO2lcb/4kMONIJXwfXxegRsi7FYPSWtXTgji3qsp8=
|
||||||
github.com/SigNoz/zap_otlp v0.1.0 h1:T7rRcFN87GavY8lDGZj0Z3Xv6OhJA6Pj3I9dNPmqvRc=
|
github.com/SigNoz/zap_otlp v0.1.0 h1:T7rRcFN87GavY8lDGZj0Z3Xv6OhJA6Pj3I9dNPmqvRc=
|
||||||
github.com/SigNoz/zap_otlp v0.1.0/go.mod h1:lcHvbDbRgvDnPxo9lDlaL1JK2PyOyouP/C3ynnYIvyo=
|
github.com/SigNoz/zap_otlp v0.1.0/go.mod h1:lcHvbDbRgvDnPxo9lDlaL1JK2PyOyouP/C3ynnYIvyo=
|
||||||
github.com/SigNoz/zap_otlp/zap_otlp_encoder v0.0.0-20230822164844-1b861a431974 h1:PKVgdf83Yw+lZJbFtNGBgqXiXNf3+kOXW2qZ7Ms7OaY=
|
github.com/SigNoz/zap_otlp/zap_otlp_encoder v0.0.0-20230822164844-1b861a431974 h1:PKVgdf83Yw+lZJbFtNGBgqXiXNf3+kOXW2qZ7Ms7OaY=
|
||||||
|
@ -192,7 +192,7 @@ services:
|
|||||||
<<: *db-depend
|
<<: *db-depend
|
||||||
|
|
||||||
otel-collector-migrator:
|
otel-collector-migrator:
|
||||||
image: signoz/signoz-schema-migrator:${OTELCOL_TAG:-0.88.9}
|
image: signoz/signoz-schema-migrator:${OTELCOL_TAG:-0.88.11}
|
||||||
container_name: otel-migrator
|
container_name: otel-migrator
|
||||||
command:
|
command:
|
||||||
- "--dsn=tcp://clickhouse:9000"
|
- "--dsn=tcp://clickhouse:9000"
|
||||||
@ -205,7 +205,7 @@ services:
|
|||||||
# condition: service_healthy
|
# condition: service_healthy
|
||||||
|
|
||||||
otel-collector:
|
otel-collector:
|
||||||
image: signoz/signoz-otel-collector:0.88.9
|
image: signoz/signoz-otel-collector:0.88.11
|
||||||
container_name: signoz-otel-collector
|
container_name: signoz-otel-collector
|
||||||
command:
|
command:
|
||||||
[
|
[
|
||||||
|
Loading…
x
Reference in New Issue
Block a user