Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

fix: adding 2 pipeline processors with same name should not break the UI (#3943)

Raj Kamal Singhf86fc03fd676
diff --git a/frontend/src/container/PipelinePage/PipelineListsView/AddNewProcessor/index.tsx b/frontend/src/container/PipelinePage/PipelineListsView/AddNewProcessor/index.tsx
index c9ab5d8aeb..8281655952 100644
--- a/frontend/src/container/PipelinePage/PipelineListsView/AddNewProcessor/index.tsx
+++ b/frontend/src/container/PipelinePage/PipelineListsView/AddNewProcessor/index.tsx
@@ -7,6 +7,7 @@ import {
PipelineData,
ProcessorData,
} from 'types/api/pipeline/def';
+import { v4 } from 'uuid';
import { ModalButtonWrapper, ModalTitle } from '../styles';
import { getEditedDataSource, getRecordIndex } from '../utils';
@@ -59,7 +60,7 @@ function AddNewProcessor({
const totalDataLength = expandedPipelineData?.config?.length || 0;
const newProcessorData = {
- id: values.name.replace(/\s/g, ''),
+ id: v4(),
orderId: Number(totalDataLength || 0) + 1,
type: processorType,
enabled: true,
@@ -73,12 +74,14 @@ function AddNewProcessor({
'id',
);
+ const processorData = expandedPipelineData?.config?.[findRecordIndex];
+
const updatedProcessorData = {
- id: values.name.replace(/\s/g, ''),
- orderId: expandedPipelineData?.config?.[findRecordIndex].orderId,
+ id: processorData?.id || v4(),
+ orderId: processorData?.orderId,
type: processorType,
- enabled: expandedPipelineData?.config?.[findRecordIndex].enabled,
- output: expandedPipelineData?.config?.[findRecordIndex].output,
+ enabled: processorData?.enabled,
+ output: processorData?.output,
...values,
};
diff --git a/frontend/src/container/PipelinePage/PipelineListsView/PipelineExpandView.tsx b/frontend/src/container/PipelinePage/PipelineListsView/PipelineExpandView.tsx
index 1e5b1add33..bcd1e37670 100644
--- a/frontend/src/container/PipelinePage/PipelineListsView/PipelineExpandView.tsx
+++ b/frontend/src/container/PipelinePage/PipelineListsView/PipelineExpandView.tsx
@@ -239,7 +239,7 @@ function PipelineExpandView({
isDarkMode={isDarkMode}
showHeader={false}
columns={columns}
- rowKey="name"
+ rowKey="id"
size="small"
components={tableComponents}
dataSource={processorData}
diff --git a/frontend/src/container/PipelinePage/tests/__snapshots__/PipelineExpandView.test.tsx.snap b/frontend/src/container/PipelinePage/tests/__snapshots__/PipelineExpandView.test.tsx.snap
index ab46e3dd8e..3b61952952 100644
--- a/frontend/src/container/PipelinePage/tests/__snapshots__/PipelineExpandView.test.tsx.snap
+++ b/frontend/src/container/PipelinePage/tests/__snapshots__/PipelineExpandView.test.tsx.snap
@@ -66,7 +66,7 @@ exports[`PipelinePage should render PipelineExpandView section 1`] = `
>
<tr
class="ant-table-row ant-table-row-level-0"
- data-row-key="grok use common asd"
+ data-row-key="grokusecommon"
draggable="true"
>
<td
@@ -97,7 +97,7 @@ exports[`PipelinePage should render PipelineExpandView section 1`] = `
</tr>
<tr
class="ant-table-row ant-table-row-level-0"
- data-row-key="rename auth"
+ data-row-key="renameauth"
draggable="true"
>
<td