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.
TypeScript apmapplication-monitoringdistributed-tracinggogood-first-issuejaegerloglogsmetricsmonitoringnextjsobservabilityopen-sourceopentelemetryprometheusreactreactjsself-hostedtracingtypescript
fix: correct query data for cluster details metric view in infra monitoring (#8380)
Amlan Kumar Nandy2196b58d3630
diff --git a/frontend/src/container/InfraMonitoringK8s/Clusters/ClusterDetails/constants.ts b/frontend/src/container/InfraMonitoringK8s/Clusters/ClusterDetails/constants.tsindex 2a84e83ca3..154b0da377 100644--- a/frontend/src/container/InfraMonitoringK8s/Clusters/ClusterDetails/constants.ts+++ b/frontend/src/container/InfraMonitoringK8s/Clusters/ClusterDetails/constants.ts@@ -731,7 +731,7 @@ export const getClusterMetricsQueryPayload = (},{selectedTime: 'GLOBAL_TIME',- graphType: PANEL_TYPES.TIME_SERIES,+ graphType: PANEL_TYPES.TABLE,query: {builder: {queryData: [@@ -751,7 +751,7 @@ export const getClusterMetricsQueryPayload = (filters: {items: [{- id: 'd7779183',+ id: 'a7da59c7',key: {dataType: DataTypes.String,id: 'k8s_cluster_name--string--tag--false',@@ -786,12 +786,12 @@ export const getClusterMetricsQueryPayload = (},],having: [],- legend: `{{${k8sDeploymentNameKey}}} ({{${k8sNamespaceNameKey}})`,+ legend: 'available',limit: null,orderBy: [],queryName: 'A',- reduceTo: 'avg',- spaceAggregation: 'max',+ reduceTo: 'last',+ spaceAggregation: 'sum',stepInterval: 60,timeAggregation: 'latest',},@@ -804,14 +804,14 @@ export const getClusterMetricsQueryPayload = (key: k8sDeploymentDesiredKey,type: 'Gauge',},- aggregateOperator: 'latest',+ aggregateOperator: 'avg',dataSource: DataSource.METRICS,disabled: false,expression: 'B',filters: {items: [{- id: 'd7779183',+ id: '55110885',key: {dataType: DataTypes.String,id: 'k8s_cluster_name--string--tag--false',@@ -846,14 +846,14 @@ export const getClusterMetricsQueryPayload = (},],having: [],- legend: `{{${k8sDeploymentNameKey}}} ({{${k8sNamespaceNameKey}})`,+ legend: 'desired',limit: null,orderBy: [],queryName: 'B',- reduceTo: 'avg',- spaceAggregation: 'max',+ reduceTo: 'last',+ spaceAggregation: 'sum',stepInterval: 60,- timeAggregation: 'latest',+ timeAggregation: 'avg',},],queryFormulas: [],@@ -890,13 +890,13 @@ export const getClusterMetricsQueryPayload = (queryType: EQueryType.QUERY_BUILDER,},variables: {},- formatForWeb: false,+ formatForWeb: true,start,end,},{selectedTime: 'GLOBAL_TIME',- graphType: PANEL_TYPES.TIME_SERIES,+ graphType: PANEL_TYPES.TABLE,query: {builder: {queryData: [@@ -909,14 +909,14 @@ export const getClusterMetricsQueryPayload = (key: k8sStatefulsetCurrentPodsKey,type: 'Gauge',},- aggregateOperator: 'latest',+ aggregateOperator: 'max',dataSource: DataSource.METRICS,disabled: false,expression: 'A',filters: {items: [{- id: 'd7779183',+ id: '3c57b4d1',key: {dataType: DataTypes.String,id: 'k8s_cluster_name--string--tag--false',@@ -951,14 +951,14 @@ export const getClusterMetricsQueryPayload = (},],having: [],- legend: `{{${k8sStatefulsetNameKey}}} ({{${k8sNamespaceNameKey}})`,+ legend: 'current',limit: null,orderBy: [],queryName: 'A',- reduceTo: 'avg',- spaceAggregation: 'max',+ reduceTo: 'last',+ spaceAggregation: 'sum',stepInterval: 60,- timeAggregation: 'latest',+ timeAggregation: 'max',},{aggregateAttribute: {@@ -969,14 +969,14 @@ export const getClusterMetricsQueryPayload = (key: k8sStatefulsetDesiredPodsKey,type: 'Gauge',},- aggregateOperator: 'latest',+ aggregateOperator: 'max',dataSource: DataSource.METRICS,disabled: false,expression: 'B',filters: {items: [{- id: 'd7779183',+ id: '0f49fe64',key: {dataType: DataTypes.String,id: 'k8s_cluster_name--string--tag--false',@@ -1011,14 +1011,14 @@ export const getClusterMetricsQueryPayload = (},],having: [],- legend: `{{${k8sStatefulsetNameKey}}} ({{${k8sNamespaceNameKey}})`,+ legend: 'desired',limit: null,orderBy: [],queryName: 'B',- reduceTo: 'avg',- spaceAggregation: 'max',+ reduceTo: 'last',+ spaceAggregation: 'sum',stepInterval: 60,- timeAggregation: 'latest',+ timeAggregation: 'max',},{aggregateAttribute: {@@ -1029,14 +1029,14 @@ export const getClusterMetricsQueryPayload = (key: k8sStatefulsetReadyPodsKey,type: 'Gauge',},- aggregateOperator: 'latest',+ aggregateOperator: 'max',dataSource: DataSource.METRICS,disabled: false,expression: 'C',filters: {items: [{- id: 'd7779183',+ id: '0bebf625',key: {dataType: DataTypes.String,id: 'k8s_cluster_name--string--tag--false',@@ -1071,14 +1071,14 @@ export const getClusterMetricsQueryPayload = (},],having: [],- legend: `{{${k8sStatefulsetNameKey}}} ({{${k8sNamespaceNameKey}})`,+ legend: 'ready',limit: null,orderBy: [],queryName: 'C',- reduceTo: 'avg',- spaceAggregation: 'max',+ reduceTo: 'last',+ spaceAggregation: 'sum',stepInterval: 60,- timeAggregation: 'latest',+ timeAggregation: 'max',},{aggregateAttribute: {@@ -1089,14 +1089,14 @@ export const getClusterMetricsQueryPayload = (key: k8sStatefulsetUpdatedPodsKey,type: 'Gauge',},- aggregateOperator: 'latest',+ aggregateOperator: 'max',dataSource: DataSource.METRICS,disabled: false,expression: 'D',filters: {items: [{- id: 'd7779183',+ id: '1ddacbbe',key: {dataType: DataTypes.String,id: 'k8s_cluster_name--string--tag--false',@@ -1131,14 +1131,14 @@ export const getClusterMetricsQueryPayload = (},],having: [],- legend: `{{${k8sStatefulsetNameKey}}} ({{${k8sNamespaceNameKey}})`,+ legend: 'updated',limit: null,orderBy: [],queryName: 'D',- reduceTo: 'avg',- spaceAggregation: 'max',+ reduceTo: 'last',+ spaceAggregation: 'sum',stepInterval: 60,- timeAggregation: 'latest',+ timeAggregation: 'max',},],queryFormulas: [],@@ -1199,13 +1199,13 @@ export const getClusterMetricsQueryPayload = (queryType: EQueryType.QUERY_BUILDER,},variables: {},- formatForWeb: false,+ formatForWeb: true,start,end,},{selectedTime: 'GLOBAL_TIME',- graphType: PANEL_TYPES.TIME_SERIES,+ graphType: PANEL_TYPES.TABLE,query: {builder: {queryData: [@@ -1218,14 +1218,14 @@ export const getClusterMetricsQueryPayload = (key: k8sDaemonsetCurrentScheduledNodesKey,type: 'Gauge',},- aggregateOperator: 'latest',+ aggregateOperator: 'avg',dataSource: DataSource.METRICS,disabled: false,expression: 'A',filters: {items: [{- id: 'd7779183',+ id: 'e0bea554',key: {dataType: DataTypes.String,id: 'k8s_cluster_name--string--tag--false',@@ -1250,24 +1250,16 @@ export const getClusterMetricsQueryPayload = (key: k8sDaemonsetNameKey,type: 'tag',},- {- dataType: DataTypes.String,- id: 'k8s_namespace_name--string--tag--false',- isColumn: false,- isJSON: false,- key: k8sNamespaceNameKey,- type: 'tag',- },],having: [],- legend: `{{${k8sDaemonsetNameKey}} ({{${k8sNamespaceNameKey}})`,+ legend: 'current_nodes',limit: null,orderBy: [],queryName: 'A',- reduceTo: 'avg',- spaceAggregation: 'max',+ reduceTo: 'last',+ spaceAggregation: 'avg',stepInterval: 60,- timeAggregation: 'latest',+ timeAggregation: 'avg',},{aggregateAttribute: {@@ -1278,14 +1270,14 @@ export const getClusterMetricsQueryPayload = (key: k8sDaemonsetDesiredScheduledNodesKey,type: 'Gauge',},- aggregateOperator: 'latest',+ aggregateOperator: 'avg',dataSource: DataSource.METRICS,disabled: false,expression: 'B',filters: {items: [{- id: 'd7779183',+ id: '741052f7',key: {dataType: DataTypes.String,id: 'k8s_cluster_name--string--tag--false',@@ -1310,24 +1302,16 @@ export const getClusterMetricsQueryPayload = (key: k8sDaemonsetNameKey,type: 'tag',},- {- dataType: DataTypes.String,- id: 'k8s_namespace_name--string--tag--false',- isColumn: false,- isJSON: false,- key: k8sNamespaceNameKey,- type: 'tag',- },],having: [],- legend: `{{${k8sDaemonsetNameKey}} ({{${k8sNamespaceNameKey}})`,+ legend: 'desired_nodes',limit: null,orderBy: [],queryName: 'B',- reduceTo: 'avg',- spaceAggregation: 'max',+ reduceTo: 'last',+ spaceAggregation: 'avg',stepInterval: 60,- timeAggregation: 'latest',+ timeAggregation: 'avg',},{aggregateAttribute: {@@ -1338,14 +1322,14 @@ export const getClusterMetricsQueryPayload = (key: k8sDaemonsetReadyNodesKey,type: 'Gauge',},- aggregateOperator: 'latest',+ aggregateOperator: 'avg',dataSource: DataSource.METRICS,disabled: false,expression: 'C',filters: {items: [{- id: 'd7779183',+ id: 'f23759f2',key: {dataType: DataTypes.String,id: 'k8s_cluster_name--string--tag--false',@@ -1370,24 +1354,16 @@ export const getClusterMetricsQueryPayload = (key: k8sDaemonsetNameKey,type: 'tag',},- {- dataType: DataTypes.String,- id: 'k8s_namespace_name--string--tag--false',- isColumn: false,- isJSON: false,- key: k8sNamespaceNameKey,- type: 'tag',- },],having: [],- legend: `{{${k8sDaemonsetNameKey}} ({{${k8sNamespaceNameKey}})`,+ legend: 'ready_nodes',limit: null,orderBy: [],queryName: 'C',- reduceTo: 'avg',- spaceAggregation: 'max',+ reduceTo: 'last',+ spaceAggregation: 'avg',stepInterval: 60,- timeAggregation: 'latest',+ timeAggregation: 'avg',},],queryFormulas: [],@@ -1436,13 +1412,13 @@ export const getClusterMetricsQueryPayload = (queryType: EQueryType.QUERY_BUILDER,},variables: {},- formatForWeb: false,+ formatForWeb: true,start,end,},{selectedTime: 'GLOBAL_TIME',- graphType: PANEL_TYPES.TIME_SERIES,+ graphType: PANEL_TYPES.TABLE,query: {builder: {queryData: [@@ -1455,14 +1431,14 @@ export const getClusterMetricsQueryPayload = (key: k8sJobActivePodsKey,type: 'Gauge',},- aggregateOperator: 'latest',+ aggregateOperator: 'max',dataSource: DataSource.METRICS,disabled: false,expression: 'A',filters: {items: [{- id: 'd7779183',+ id: 'fd485d85',key: {dataType: DataTypes.String,id: 'k8s_cluster_name--string--tag--false',@@ -1497,14 +1473,14 @@ export const getClusterMetricsQueryPayload = (},],having: [],- legend: `{{${k8sJobNameKey}}} ({{${k8sNamespaceNameKey}})`,+ legend: 'running',limit: null,orderBy: [],queryName: 'A',- reduceTo: 'avg',- spaceAggregation: 'max',+ reduceTo: 'last',+ spaceAggregation: 'sum',stepInterval: 60,- timeAggregation: 'latest',+ timeAggregation: 'max',},{aggregateAttribute: {@@ -1515,14 +1491,14 @@ export const getClusterMetricsQueryPayload = (key: k8sJobSuccessfulPodsKey,type: 'Gauge',},- aggregateOperator: 'latest',+ aggregateOperator: 'max',dataSource: DataSource.METRICS,disabled: false,expression: 'B',filters: {items: [{- id: 'd7779183',+ id: 'fc1beb81',key: {dataType: DataTypes.String,id: 'k8s_cluster_name--string--tag--false',@@ -1557,14 +1533,14 @@ export const getClusterMetricsQueryPayload = (},],having: [],- legend: `{{${k8sJobNameKey}}} ({{${k8sNamespaceNameKey}})`,+ legend: 'successful',limit: null,orderBy: [],queryName: 'B',- reduceTo: 'avg',- spaceAggregation: 'max',+ reduceTo: 'last',+ spaceAggregation: 'sum',stepInterval: 60,- timeAggregation: 'latest',+ timeAggregation: 'max',},{aggregateAttribute: {@@ -1575,14 +1551,14 @@ export const getClusterMetricsQueryPayload = (key: k8sJobFailedPodsKey,type: 'Gauge',},- aggregateOperator: 'latest',+ aggregateOperator: 'max',dataSource: DataSource.METRICS,disabled: false,expression: 'C',filters: {items: [{- id: 'd7779183',+ id: '97773348',key: {dataType: DataTypes.String,id: 'k8s_cluster_name--string--tag--false',@@ -1617,14 +1593,14 @@ export const getClusterMetricsQueryPayload = (},],having: [],- legend: `{{${k8sJobNameKey}}} ({{${k8sNamespaceNameKey}})`,+ legend: 'failed',limit: null,orderBy: [],queryName: 'C',- reduceTo: 'avg',- spaceAggregation: 'max',+ reduceTo: 'last',+ spaceAggregation: 'sum',stepInterval: 60,- timeAggregation: 'latest',+ timeAggregation: 'max',},{aggregateAttribute: {@@ -1635,14 +1611,14 @@ export const getClusterMetricsQueryPayload = (key: k8sJobDesiredSuccessfulPodsKey,type: 'Gauge',},- aggregateOperator: 'latest',+ aggregateOperator: 'max',dataSource: DataSource.METRICS,disabled: false,expression: 'D',filters: {items: [{- id: 'd7779183',+ id: '5911618b',key: {dataType: DataTypes.String,id: 'k8s_cluster_name--string--tag--false',@@ -1677,14 +1653,14 @@ export const getClusterMetricsQueryPayload = (},],having: [],- legend: `{{${k8sJobNameKey}}} ({{${k8sNamespaceNameKey}})`,+ legend: 'desired successful',limit: null,orderBy: [],queryName: 'D',- reduceTo: 'avg',- spaceAggregation: 'max',+ reduceTo: 'last',+ spaceAggregation: 'sum',stepInterval: 60,- timeAggregation: 'latest',+ timeAggregation: 'max',},],queryFormulas: [],@@ -1745,279 +1721,6 @@ export const getClusterMetricsQueryPayload = (queryType: EQueryType.QUERY_BUILDER,},variables: {},- formatForWeb: false,- start,- end,- },- {- selectedTime: 'GLOBAL_TIME',- graphType: PANEL_TYPES.TABLE,- query: {- builder: {- queryData: [- {- aggregateAttribute: {- dataType: DataTypes.Float64,- id: 'k8s_job_active_pods--float64--Gauge--true',- isColumn: true,- isJSON: false,- key: k8sJobActivePodsKey,- type: 'Gauge',- },- aggregateOperator: 'max',- dataSource: DataSource.METRICS,- disabled: false,- expression: 'A',- filters: {- items: [- {- id: 'fd485d85',- key: {- dataType: DataTypes.String,- id: 'k8s_cluster_name--string--tag--false',- isColumn: false,- isJSON: false,- key: 'k8s_cluster_name',- type: 'tag',- },- op: '=',- value: cluster.meta.k8s_cluster_name,- },- ],- op: 'AND',- },- functions: [],- groupBy: [- {- dataType: DataTypes.String,- id: 'k8s_job_name--string--tag--false',- isColumn: false,- isJSON: false,- key: k8sJobNameKey,- type: 'tag',- },- {- dataType: DataTypes.String,- id: 'k8s_namespace_name--string--tag--false',- isColumn: false,- isJSON: false,- key: k8sNamespaceNameKey,- type: 'tag',- },- ],- having: [],- legend: 'running',- limit: null,- orderBy: [],- queryName: 'A',- reduceTo: 'last',- spaceAggregation: 'sum',- stepInterval: 60,- timeAggregation: 'max',- },- {- aggregateAttribute: {- dataType: DataTypes.Float64,- id: 'k8s_job_successful_pods--float64--Gauge--true',- isColumn: true,- isJSON: false,- key: k8sJobSuccessfulPodsKey,- type: 'Gauge',- },- aggregateOperator: 'max',- dataSource: DataSource.METRICS,- disabled: false,- expression: 'B',- filters: {- items: [- {- id: 'fc1beb81',- key: {- dataType: DataTypes.String,- id: 'k8s_cluster_name--string--tag--false',- isColumn: false,- isJSON: false,- key: 'k8s_cluster_name',- type: 'tag',- },- op: '=',- value: cluster.meta.k8s_cluster_name,- },- ],- op: 'AND',- },- functions: [],- groupBy: [- {- dataType: DataTypes.String,- id: 'k8s_job_name--string--tag--false',- isColumn: false,- isJSON: false,- key: k8sJobNameKey,- type: 'tag',- },- {- dataType: DataTypes.String,- id: 'k8s_namespace_name--string--tag--false',- isColumn: false,- isJSON: false,- key: k8sNamespaceNameKey,- type: 'tag',- },- ],- having: [],- legend: 'successful',- limit: null,- orderBy: [],- queryName: 'B',- reduceTo: 'last',- spaceAggregation: 'sum',- stepInterval: 60,- timeAggregation: 'max',- },- {- aggregateAttribute: {- dataType: DataTypes.Float64,- id: 'k8s_job_failed_pods--float64--Gauge--true',- isColumn: true,- isJSON: false,- key: k8sJobFailedPodsKey,- type: 'Gauge',- },- aggregateOperator: 'max',- dataSource: DataSource.METRICS,- disabled: false,- expression: 'C',- filters: {- items: [- {- id: '97773348',- key: {- dataType: DataTypes.String,- id: 'k8s_cluster_name--string--tag--false',- isColumn: false,- isJSON: false,- key: 'k8s_cluster_name',- type: 'tag',- },- op: '=',- value: cluster.meta.k8s_cluster_name,- },- ],- op: 'AND',- },- functions: [],- groupBy: [- {- dataType: DataTypes.String,- id: 'k8s_job_name--string--tag--false',- isColumn: false,- isJSON: false,- key: k8sJobNameKey,- type: 'tag',- },- {- dataType: DataTypes.String,- id: 'k8s_namespace_name--string--tag--false',- isColumn: false,- isJSON: false,- key: k8sNamespaceNameKey,- type: 'tag',- },- ],- having: [],- legend: 'failed',- limit: null,- orderBy: [],- queryName: 'C',- reduceTo: 'last',- spaceAggregation: 'sum',- stepInterval: 60,- timeAggregation: 'max',- },- {- aggregateAttribute: {- dataType: DataTypes.Float64,- id: 'k8s_job_desired_successful_pods--float64--Gauge--true',- isColumn: true,- isJSON: false,- key: k8sJobDesiredSuccessfulPodsKey,- type: 'Gauge',- },- aggregateOperator: 'max',- dataSource: DataSource.METRICS,- disabled: false,- expression: 'D',- filters: {- items: [- {- id: '5911618b',- key: {- dataType: DataTypes.String,- id: 'k8s_cluster_name--string--tag--false',- isColumn: false,- isJSON: false,- key: 'k8s_cluster_name',- type: 'tag',- },- op: '=',- value: cluster.meta.k8s_cluster_name,- },- ],- op: 'AND',- },- functions: [],- groupBy: [- {- dataType: DataTypes.String,- id: 'k8s_job_name--string--tag--false',- isColumn: false,- isJSON: false,- key: k8sJobNameKey,- type: 'tag',- },- {- dataType: DataTypes.String,- id: 'k8s_namespace_name--string--tag--false',- isColumn: false,- isJSON: false,- key: k8sNamespaceNameKey,- type: 'tag',- },- ],- having: [],- legend: 'desired successful',- limit: null,- orderBy: [],- queryName: 'D',- reduceTo: 'last',- spaceAggregation: 'sum',- stepInterval: 60,- timeAggregation: 'max',- },- ],- queryFormulas: [],- },- clickhouse_sql: [- {- disabled: false,- legend: '',- name: 'A',- query: '',- },- ],- id: v4(),- promql: [- {- disabled: false,- legend: '',- name: 'A',- query: '',- },- ],- queryType: EQueryType.QUERY_BUILDER,- },- variables: {},formatForWeb: true,start,end,