Skip to content

Commit

Permalink
Merge pull request SigNoz#4177 from SigNoz/release/v0.35.0
Browse files Browse the repository at this point in the history
Release/v0.35.0
  • Loading branch information
prashant-shahi authored Dec 6, 2023
2 parents 07d126c + 09d5793 commit 16502fe
Show file tree
Hide file tree
Showing 87 changed files with 2,277 additions and 1,260 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
id: short-sha
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v5.1
uses: tj-actions/branch-names@v7.0.7
- name: Set docker tag environment
run: |
if [ '${{ steps.branch-name.outputs.is_tag }}' == 'true' ]; then
Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:
id: short-sha
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v5.1
uses: tj-actions/branch-names@v7.0.7
- name: Set docker tag environment
run: |
if [ '${{ steps.branch-name.outputs.is_tag }}' == 'true' ]; then
Expand Down Expand Up @@ -127,7 +127,7 @@ jobs:
id: short-sha
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v5.1
uses: tj-actions/branch-names@v7.0.7
- name: Set docker tag environment
run: |
if [ '${{ steps.branch-name.outputs.is_tag }}' == 'true' ]; then
Expand Down Expand Up @@ -176,7 +176,7 @@ jobs:
id: short-sha
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v5.1
uses: tj-actions/branch-names@v7.0.7
- name: Set docker tag environment
run: |
if [ '${{ steps.branch-name.outputs.is_tag }}' == 'true' ]; then
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/staging-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
export PATH="/usr/local/go/bin/:$PATH" # needed for Golang to work
docker system prune --force
docker pull signoz/signoz-otel-collector:main
docker pull signoz/signoz/signoz-schema-migrator:main
docker pull signoz/signoz-schema-migrator:main
cd ~/signoz
git status
git add .
Expand Down
4 changes: 2 additions & 2 deletions deploy/docker-swarm/clickhouse-setup/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ services:
condition: on-failure

query-service:
image: signoz/query-service:0.34.4
image: signoz/query-service:0.35.0
command:
[
"-config=/root/config/prometheus.yml",
Expand Down Expand Up @@ -186,7 +186,7 @@ services:
<<: *db-depend

frontend:
image: signoz/frontend:0.34.4
image: signoz/frontend:0.35.0
deploy:
restart_policy:
condition: on-failure
Expand Down
4 changes: 2 additions & 2 deletions deploy/docker/clickhouse-setup/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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`

query-service:
image: signoz/query-service:${DOCKER_TAG:-0.34.4}
image: signoz/query-service:${DOCKER_TAG:-0.35.0}
container_name: signoz-query-service
command:
[
Expand Down Expand Up @@ -203,7 +203,7 @@ services:
<<: *db-depend

frontend:
image: signoz/frontend:${DOCKER_TAG:-0.34.4}
image: signoz/frontend:${DOCKER_TAG:-0.35.0}
container_name: signoz-frontend
restart: on-failure
depends_on:
Expand Down
2 changes: 1 addition & 1 deletion ee/query-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# use a minimal alpine image
FROM alpine:3.18.3
FROM alpine:3.18.5

# Add Maintainer Info
LABEL maintainer="signoz"
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/AppRoutes/pageComponents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ export const Onboarding = Loadable(
);

export const DashboardPage = Loadable(
() => import(/* webpackChunkName: "DashboardPage" */ 'pages/Dashboard'),
() =>
import(/* webpackChunkName: "DashboardPage" */ 'pages/DashboardsListPage'),
);

export const NewDashboardPage = Loadable(
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/api/dashboard/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { AxiosError } from 'axios';
import { ErrorResponse, SuccessResponse } from 'types/api';
import { PayloadProps, Props } from 'types/api/dashboard/update';

const update = async (
const updateDashboard = async (
props: Props,
): Promise<SuccessResponse<PayloadProps> | ErrorResponse> => {
try {
Expand All @@ -23,4 +23,4 @@ const update = async (
}
};

export default update;
export default updateDashboard;
30 changes: 30 additions & 0 deletions frontend/src/api/dashboard/variables/dashboardVariablesQuery.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { ApiV2Instance as axios } from 'api';
import { ErrorResponseHandler } from 'api/ErrorResponseHandler';
import { AxiosError } from 'axios';
import { ErrorResponse, SuccessResponse } from 'types/api';
import {
Props,
VariableResponseProps,
} from 'types/api/dashboard/variables/query';

const dashboardVariablesQuery = async (
props: Props,
): Promise<SuccessResponse<VariableResponseProps> | ErrorResponse> => {
try {
const response = await axios.post(`/variables/query`, props);

return {
statusCode: 200,
error: null,
message: response.data.status,
payload: response.data.data,
};
} catch (error) {
const formattedError = ErrorResponseHandler(error as AxiosError);

// eslint-disable-next-line @typescript-eslint/no-throw-literal
throw { message: 'Error fetching data', details: formattedError };
}
};

export default dashboardVariablesQuery;
24 changes: 0 additions & 24 deletions frontend/src/api/dashboard/variables/query.ts

This file was deleted.

2 changes: 1 addition & 1 deletion frontend/src/components/ExplorerCard/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export const deleteViewHandler = ({
if (viewId === viewKey) {
redirectWithQueryBuilderData(
updateAllQueriesOperators(
initialQueriesMap.traces,
initialQueriesMap[sourcePage],
panelType || PANEL_TYPES.LIST,
sourcePage,
),
Expand Down
1 change: 1 addition & 0 deletions frontend/src/constants/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ export enum QueryParams {
viewName = 'viewName',
viewKey = 'viewKey',
expandedWidgetId = 'expandedWidgetId',
pagination = 'pagination',
}
26 changes: 16 additions & 10 deletions frontend/src/container/FormAlertRules/ChartPreview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { InfoCircleOutlined } from '@ant-design/icons';
import Spinner from 'components/Spinner';
import { initialQueriesMap, PANEL_TYPES } from 'constants/queryBuilder';
import GridPanelSwitch from 'container/GridPanelSwitch';
import { getFormatNameByOptionId } from 'container/NewWidget/RightContainer/alertFomatCategories';
import { timePreferenceType } from 'container/NewWidget/RightContainer/timeItems';
import { Time } from 'container/TopNav/DateTimeSelection/config';
import { useGetQueryRange } from 'hooks/queryBuilder/useGetQueryRange';
Expand All @@ -19,7 +20,7 @@ import { EQueryType } from 'types/common/dashboard';
import { GlobalReducer } from 'types/reducer/globalTime';

import { ChartContainer, FailedMessageContainer } from './styles';
import { covertIntoDataFormats } from './utils';
import { getThresholdLabel } from './utils';

export interface ChartPreviewProps {
name: string;
Expand Down Expand Up @@ -50,12 +51,6 @@ function ChartPreview({
(state) => state.globalTime,
);

const thresholdValue = covertIntoDataFormats({
value: threshold,
sourceUnit: alertDef?.condition.targetUnit,
targetUnit: query?.unit,
});

const canQuery = useMemo((): boolean => {
if (!query || query == null) {
return false;
Expand Down Expand Up @@ -110,6 +105,9 @@ function ChartPreview({

const isDarkMode = useIsDarkMode();

const optionName =
getFormatNameByOptionId(alertDef?.condition.targetUnit || '') || '';

const options = useMemo(
() =>
getUPlotChartOptions({
Expand All @@ -124,10 +122,16 @@ function ChartPreview({
keyIndex: 0,
moveThreshold: (): void => {},
selectedGraph: PANEL_TYPES.TIME_SERIES, // no impact
thresholdValue,
thresholdValue: threshold,
thresholdLabel: `${t(
'preview_chart_threshold_label',
)} (y=${thresholdValue} ${query?.unit || ''})`,
)} (y=${getThresholdLabel(
optionName,
threshold,
alertDef?.condition.targetUnit,
query?.unit,
)})`,
thresholdUnit: alertDef?.condition.targetUnit,
},
],
}),
Expand All @@ -136,8 +140,10 @@ function ChartPreview({
queryResponse?.data?.payload,
containerDimensions,
isDarkMode,
threshold,
t,
thresholdValue,
optionName,
alertDef?.condition.targetUnit,
],
);

Expand Down
15 changes: 15 additions & 0 deletions frontend/src/container/FormAlertRules/ChartPreview/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,21 @@ export function covertIntoDataFormats({
return Number.isNaN(result) ? 0 : result;
}

export const getThresholdLabel = (
optionName: string,
value: number,
unit?: string,
yAxisUnit?: string,
): string => {
if (
unit === MiscellaneousFormats.PercentUnit ||
yAxisUnit === MiscellaneousFormats.PercentUnit
) {
return `${value * 100}%`;
}
return `${value} ${optionName}`;
};

interface IUnit {
value: number;
sourceUnit?: string;
Expand Down
33 changes: 20 additions & 13 deletions frontend/src/container/GridCardLayout/GridCard/FullView/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,26 @@ export const getDefaultTableDataSet = (
data: uPlot.AlignedData,
): ExtendedChartDataset[] =>
options.series.map(
(item: uPlot.Series, index: number): ExtendedChartDataset => ({
...item,
index,
show: true,
sum: convertToTwoDecimalsOrZero(
(data[index] as number[]).reduce((a, b) => a + b, 0),
),
avg: convertToTwoDecimalsOrZero(
(data[index] as number[]).reduce((a, b) => a + b, 0) / data[index].length,
),
max: convertToTwoDecimalsOrZero(Math.max(...(data[index] as number[]))),
min: convertToTwoDecimalsOrZero(Math.min(...(data[index] as number[]))),
}),
(item: uPlot.Series, index: number): ExtendedChartDataset => {
let arr: number[];
if (data[index]) {
arr = data[index] as number[];
} else {
arr = [];
}

return {
...item,
index,
show: true,
sum: convertToTwoDecimalsOrZero(arr.reduce((a, b) => a + b, 0) || 0),
avg: convertToTwoDecimalsOrZero(
(arr.reduce((a, b) => a + b, 0) || 0) / (arr.length || 1),
),
max: convertToTwoDecimalsOrZero(Math.max(...arr)),
min: convertToTwoDecimalsOrZero(Math.min(...arr)),
};
},
);

export const getAbbreviatedLabel = (label: string): string => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function WidgetGraphComponent({
const [deleteModal, setDeleteModal] = useState(false);
const [hovered, setHovered] = useState(false);
const { notifications } = useNotifications();
const { pathname } = useLocation();
const { pathname, search } = useLocation();

const params = useUrlQuery();

Expand Down Expand Up @@ -183,10 +183,20 @@ function WidgetGraphComponent({
const queryParams = {
[QueryParams.expandedWidgetId]: widget.id,
};
const updatedSearch = createQueryParams(queryParams);
const existingSearch = new URLSearchParams(search);
const isExpandedWidgetIdPresent = existingSearch.has(
QueryParams.expandedWidgetId,
);
if (isExpandedWidgetIdPresent) {
existingSearch.delete(QueryParams.expandedWidgetId);
}
const separator = existingSearch.toString() ? '&' : '';
const newSearch = `${existingSearch}${separator}${updatedSearch}`;

history.push({
pathname,
search: createQueryParams(queryParams),
search: newSearch,
});
};

Expand All @@ -199,9 +209,12 @@ function WidgetGraphComponent({
};

const onToggleModelHandler = (): void => {
const existingSearchParams = new URLSearchParams(search);
existingSearchParams.delete(QueryParams.expandedWidgetId);
const updatedQueryParams = Object.fromEntries(existingSearchParams.entries());
history.push({
pathname,
search: createQueryParams({}),
search: createQueryParams(updatedQueryParams),
});
};

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.widget-header-container {
display: flex;
justify-content: space-between;
align-items: center;
height: 30px;
width: 100%;
padding: 0.5rem;
}

.widget-header-title {
max-width: 80%;
}

.widget-header-actions {
display: flex;
align-items: center;
}
.widget-header-more-options {
visibility: hidden;
border: none;
box-shadow: none;
}

.widget-header-hover {
visibility: visible;
}

.widget-api-actions {
padding-right: 0.25rem;
}
Loading

0 comments on commit 16502fe

Please sign in to comment.