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

chore: sync develop and deprecation related changes #6635

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: build-pipeline
on:
pull_request:
branches:
- develop
- main
- release/v*

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "Update PR labels and Block PR until related docs are shipped for the feat
on:
pull_request:
branches:
- develop
- main
types: [opened, edited, labeled, unlabeled]

permissions:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-k3s.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
kubectl create ns sample-application
# apply hotrod k8s manifest file
kubectl -n sample-application apply -f https://raw.githubusercontent.com/SigNoz/signoz/develop/sample-apps/hotrod/hotrod.yaml
kubectl -n sample-application apply -f https://raw.githubusercontent.com/SigNoz/signoz/main/sample-apps/hotrod/hotrod.yaml
# wait for all deployments in sample-application namespace to be READY
kubectl -n sample-application get deploy --output name | xargs -r -n1 -t kubectl -n sample-application rollout status --timeout=300s
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/jest-coverage-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: Jest Coverage - changed files

on:
pull_request:
branches: develop
branches:
- main

jobs:
build:
Expand All @@ -11,7 +12,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
ref: "refs/heads/develop"
ref: "refs/heads/main"
token: ${{ secrets.GITHUB_TOKEN }} # Provide the GitHub token for authentication

- name: Fetch branch
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- main
- develop
tags:
- v*

Expand Down
1 change: 0 additions & 1 deletion .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ on:
pull_request:
branches:
- main
- develop
paths:
- 'frontend/**'
defaults:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/staging-deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: staging-deployment
# Trigger deployment only on push to develop branch
# Trigger deployment only on push to main branch
on:
push:
branches:
- develop
- main
jobs:
deploy:
name: Deploy latest develop branch to staging
name: Deploy latest main branch to staging
runs-on: ubuntu-latest
environment: staging
permissions:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/testing-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
git add .
git stash push -m "stashed on $(date --iso-8601=seconds)"
git fetch origin
git checkout develop
git checkout main
git pull
# This is added to include the scenerio when new commit in PR is force-pushed
git branch -D ${GITHUB_BRANCH}
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ to make SigNoz UI available at [localhost:3301](http://localhost:3301)
**5.1.1 To install the HotROD sample app:**
```bash
curl -sL https://github.com/SigNoz/signoz/raw/develop/sample-apps/hotrod/hotrod-install.sh \
curl -sL https://github.com/SigNoz/signoz/raw/main/sample-apps/hotrod/hotrod-install.sh \
| HELM_RELEASE=my-release SIGNOZ_NAMESPACE=platform bash
```
Expand All @@ -362,7 +362,7 @@ kubectl -n sample-application run strzal --image=djbingham/curl \
**5.1.4 To delete the HotROD sample app:**
```bash
curl -sL https://github.com/SigNoz/signoz/raw/develop/sample-apps/hotrod/hotrod-delete.sh \
curl -sL https://github.com/SigNoz/signoz/raw/main/sample-apps/hotrod/hotrod-delete.sh \
| HOTROD_NAMESPACE=sample-application bash
```
Expand Down
2 changes: 1 addition & 1 deletion deploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ from the HotROD application, you should see the data generated from hotrod in Si
```sh
kubectl create ns sample-application

kubectl -n sample-application apply -f https://raw.githubusercontent.com/SigNoz/signoz/develop/sample-apps/hotrod/hotrod.yaml
kubectl -n sample-application apply -f https://raw.githubusercontent.com/SigNoz/signoz/main/sample-apps/hotrod/hotrod.yaml
```

To generate load:
Expand Down
5 changes: 0 additions & 5 deletions frontend/.husky/commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,3 @@ if [ "$branch" = "main" ]; then
echo "${color_red}${bold}You can't commit directly to the main branch${reset}"
exit 1
fi

if [ "$branch" = "develop" ]; then
echo "${color_red}${bold}You can't commit directly to the develop branch${reset}"
exit 1
fi
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import axios from 'api';
import { ErrorResponse, SuccessResponse } from 'types/api';

import {
MessagingQueueServicePayload,
MessagingQueuesPayloadProps,
} from './getConsumerLagDetails';
} from 'pages/MessagingQueues/MQDetails/MQTables/getConsumerLagDetails';
import { ErrorResponse, SuccessResponse } from 'types/api';

export const getTopicThroughputOverview = async (
props: Omit<MessagingQueueServicePayload, 'variables'>,
Expand Down
7 changes: 0 additions & 7 deletions frontend/src/pages/MessagingQueues/MQDetails/MQDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,6 @@ const checkValidityOfDetailConfigs = (
return false;
}

if (currentTab === MessagingQueueServiceDetailType.ProducerDetails) {
return Boolean(
configDetails?.topic &&
configDetails?.partition &&
configDetails?.service_name,
);
}
return Boolean(configDetails?.topic && configDetails?.service_name);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { RowData } from 'pages/MessagingQueues/MessagingQueuesUtils';

import { MessagingQueuesPayloadProps } from './getConsumerLagDetails';

export function getTableDataForProducerLatencyOverview(
data: MessagingQueuesPayloadProps['payload'],
): RowData[] {
if (data?.result?.length === 0) {
return [];
}

const firstTableData = data.result[0].table.rows || [];
const secondTableData = data.result[1]?.table.rows || [];

// Create a map for quick lookup of byte_rate using service_name and topic
const byteRateMap = new Map(
secondTableData.map((row) => [
`${row.data.service_name}--${row.data.topic}`,
row.data.byte_rate,
]),
);

// Merge the data from both tables
const mergedTableData: RowData[] =
firstTableData.map(
(row, index): RowData => ({
...row.data,
byte_rate:
byteRateMap.get(`${row.data.service_name}--${row.data.topic}`) || 0,
key: index,
}),
) || [];

return mergedTableData;
}
53 changes: 45 additions & 8 deletions frontend/src/pages/MessagingQueues/MQDetails/MQTables/MQTables.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,32 @@ import {
MessagingQueueServicePayload,
MessagingQueuesPayloadProps,
} from './getConsumerLagDetails';
import { getTableDataForProducerLatencyOverview } from './MQTableUtils';

const INITIAL_PAGE_SIZE = 10;

// eslint-disable-next-line sonarjs/cognitive-complexity
export function getColumns(
data: MessagingQueuesPayloadProps['payload'],
history: History<unknown>,
isProducerOverview?: boolean,
): RowData[] {
if (data?.result?.length === 0) {
return [];
}

const mergedColumns = isProducerOverview
? [
...(data?.result?.[0]?.table?.columns || []),
{ name: 'byte_rate', queryName: 'byte_rate' },
]
: data?.result?.[0]?.table?.columns;

const columns: {
title: string;
dataIndex: string;
key: string;
}[] = data?.result?.[0]?.table?.columns.map((column) => ({
}[] = mergedColumns.map((column) => ({
title: convertToTitleCase(column.name),
dataIndex: column.name,
key: column.name,
Expand All @@ -58,6 +67,8 @@ export function getColumns(
'throughput',
'avg_msg_size',
'error_percentage',
'ingestion_rate',
'byte_rate',
].includes(column.name)
? (value: number | string): string => {
if (!isNumber(value)) return value.toString();
Expand Down Expand Up @@ -172,13 +183,25 @@ function MessagingQueuesTable({
});
};

const isProducerOverview = useMemo(
() =>
type === 'Overview' &&
selectedView === MessagingQueuesViewType.producerLatency.value &&
tableApiPayload?.detailType === 'producer',
[type, selectedView, tableApiPayload],
);

const { mutate: getViewDetails, isLoading, error, isError } = useMutation(
tableApi,
{
onSuccess: (data) => {
if (data.payload) {
setColumns(getColumns(data?.payload, history));
setTableData(getTableData(data?.payload));
setColumns(getColumns(data?.payload, history, isProducerOverview));
setTableData(
isProducerOverview
? getTableDataForProducerLatencyOverview(data?.payload)
: getTableData(data?.payload),
);
}
},
onError: handleConsumerDetailsOnError,
Expand All @@ -199,15 +222,29 @@ function MessagingQueuesTable({
const [, setSelectedRows] = useState<any>();
const location = useLocation();

const onRowClick = (record: { [key: string]: string }): void => {
const selectedKey = record.key;
const selectedRowKeyGenerator = (record: {
[key: string]: string;
}): React.Key => {
if (!isEmpty(tableApiPayload?.detailType)) {
return `${record.key}_${selectedView}_${tableApiPayload?.detailType}`;
}
return `${record.key}_${selectedView}`;
};

useEffect(() => {
if (isEmpty(configDetailQueryData)) {
setSelectedRowKey(undefined);
setSelectedRows({});
}
}, [configDetailQueryData]);

if (`${selectedKey}_${selectedView}` === selectedRowKey) {
const onRowClick = (record: { [key: string]: string }): void => {
if (selectedRowKeyGenerator(record) === selectedRowKey) {
setSelectedRowKey(undefined);
setSelectedRows({});
setConfigDetail(urlQuery, location, history, {});
} else {
setSelectedRowKey(`${selectedKey}_${selectedView}`);
setSelectedRowKey(selectedRowKeyGenerator(record));
setSelectedRows(record);

if (!isEmpty(record)) {
Expand Down Expand Up @@ -267,7 +304,7 @@ function MessagingQueuesTable({
: {}
}
rowClassName={(record): any =>
`${record.key}_${selectedView}` === selectedRowKey
selectedRowKeyGenerator(record) === selectedRowKey
? 'ant-table-row-selected'
: ''
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,44 @@
import './MQDetails.style.scss';

import { Radio } from 'antd';
import { Dispatch, SetStateAction } from 'react';
import { getTopicThroughputOverview } from 'api/messagingQueues/getTopicThroughputOverview';
import useUrlQuery from 'hooks/useUrlQuery';
import { Dispatch, SetStateAction, useMemo } from 'react';
import { useSelector } from 'react-redux';
import { useHistory, useLocation } from 'react-router-dom';
import { AppState } from 'store/reducers';
import { GlobalReducer } from 'types/reducer/globalTime';

import {
MessagingQueuesViewType,
MessagingQueuesViewTypeOptions,
ProducerLatencyOptions,
setConfigDetail,
} from '../MessagingQueuesUtils';
import { MessagingQueueServicePayload } from './MQTables/getConsumerLagDetails';
import { getKafkaSpanEval } from './MQTables/getKafkaSpanEval';
import { getPartitionLatencyOverview } from './MQTables/getPartitionLatencyOverview';
import { getTopicThroughputOverview } from './MQTables/getTopicThroughputOverview';
import MessagingQueuesTable from './MQTables/MQTables';

type SelectedViewType = keyof typeof MessagingQueuesViewType;

function PartitionLatencyTabs({
function ProducerLatencyTabs({
option,
setOption,
}: {
option: ProducerLatencyOptions;
setOption: Dispatch<SetStateAction<ProducerLatencyOptions>>;
}): JSX.Element {
const urlQuery = useUrlQuery();
const location = useLocation();
const history = useHistory();

return (
<Radio.Group
onChange={(e): void => setOption(e.target.value)}
onChange={(e): void => {
setConfigDetail(urlQuery, location, history, {});
setOption(e.target.value);
}}
value={option}
className="mq-details-options"
>
Expand Down Expand Up @@ -71,27 +81,26 @@ function MessagingQueueOverview({
(state) => state.globalTime,
);

const tableApiPayload: MessagingQueueServicePayload = {
variables: {},
start: minTime,
end: maxTime,
detailType:
// eslint-disable-next-line no-nested-ternary
selectedView === MessagingQueuesViewType.producerLatency.value
? option === ProducerLatencyOptions.Producers
? 'producer'
: 'consumer'
: undefined,
evalTime:
selectedView === MessagingQueuesViewType.dropRate.value
? 2363404
: undefined,
};
const tableApiPayload: MessagingQueueServicePayload = useMemo(
() => ({
variables: {},
start: minTime,
end: maxTime,
detailType:
// eslint-disable-next-line no-nested-ternary
selectedView === MessagingQueuesViewType.producerLatency.value
? option === ProducerLatencyOptions.Producers
? 'producer'
: 'consumer'
: undefined,
}),
[minTime, maxTime, selectedView, option],
);

return (
<div className="mq-overview-container">
{selectedView === MessagingQueuesViewType.producerLatency.value ? (
<PartitionLatencyTabs option={option} setOption={setOption} />
<ProducerLatencyTabs option={option} setOption={setOption} />
) : (
<div className="mq-overview-title">
{MessagingQueuesViewType[selectedView as SelectedViewType].label}
Expand Down
Loading
Loading