diff --git a/config/advanced-install/namespaced-numaflow-server.yaml b/config/advanced-install/namespaced-numaflow-server.yaml index dc48dbd16..31ae9725d 100644 --- a/config/advanced-install/namespaced-numaflow-server.yaml +++ b/config/advanced-install/namespaced-numaflow-server.yaml @@ -209,27 +209,35 @@ data: cpu and memory utilization by pod for mono-vertex\n expr: avg_over_time($metric_name{$filters}[$duration])\n \ params:\n - name: duration\n required: true\n - name: start_time\n \ required: false\n - name: end_time\n required: false\n metrics: - \n - metric_name: namespace_pod_cpu_utilization\n display_name: CPU Utilization + \n # set your cpu metric name here\n - metric_name: namespace_pod_cpu_utilization\n + \ # set display name as per metric name\n display_name: CPU Utilization per Pod (usage seconds/resource limits)\n required_filters:\n - namespace\n - \ # to get only mono-vertex pods\n - pod \n dimensions:\n - - name: mono-vertex\n filters: \n - name: pod \n required: - false\n - metric_name: namespace_pod_memory_utilization\n display_name: - Memory Utilization per Pod (usage bytes/resource limits)\n required_filters:\n - \ - namespace\n # to get only mono-vertex pods\n - pod \n - \ dimensions:\n - name: mono-vertex\n filters: \n - - name: pod \n required: false\n- name: pipeline_vertex_cpu_memory_utilization_pod\n - \ object: vertex\n title: cpu-memory utilization by pod\n description: cpu and - memory utilization by pod for pipeline's vertex\n expr: avg_over_time($metric_name{$filters}[$duration])\n + \ - pod \n dimensions:\n - name: mono-vertex\n filters: + \n - name: pod\n # expr: optional expression for prometheus + query\n # overrides the default expression\n required: + false\n # set your memory metric name here\n - metric_name: namespace_pod_memory_utilization\n + \ # set display name as per metric name\n display_name: Memory Utilization + per Pod (usage bytes/resource limits)\n required_filters:\n - namespace\n + \ - pod \n dimensions:\n - name: mono-vertex\n filters: + \n - name: pod\n # expr: optional expression for prometheus + query\n # overrides the default expression \n required: + false\n- name: pipeline_vertex_cpu_memory_utilization_pod\n object: vertex\n + \ title: cpu-memory utilization by pod\n description: cpu and memory utilization + by pod for pipeline's vertex\n expr: avg_over_time($metric_name{$filters}[$duration])\n \ params:\n - name: duration\n required: true\n - name: start_time\n \ required: false\n - name: end_time\n required: false\n metrics: - \n - metric_name: namespace_pod_cpu_utilization\n display_name: CPU Utilization + \n # set your cpu metric name here\n - metric_name: namespace_pod_cpu_utilization\n + \ # set display name as per metric name\n display_name: CPU Utilization per Pod (usage seconds/resource limits)\n required_filters:\n - namespace\n - \ # to get only vertex pods\n - pod \n dimensions:\n - - name: vertex\n filters: \n - name: pod \n required: - false\n - metric_name: namespace_pod_memory_utilization\n display_name: - Memory Utilization per Pod (usage bytes/resource limits)\n required_filters:\n - \ - namespace\n # to get only vertex pods\n - pod \n dimensions:\n - \ - name: vertex\n filters: \n - name: pod \n required: + \ - pod \n dimensions:\n - name: vertex\n filters: + \n - name: pod\n # expr: optional expression for prometheus + query\n # overrides the default expression \n required: + false\n # set your memory metric name here\n - metric_name: namespace_pod_memory_utilization\n + \ # set display name as per metric name\n display_name: Memory Utilization + per Pod (usage bytes/resource limits)\n required_filters:\n - namespace\n + \ - pod \n dimensions:\n - name: vertex\n filters: + \n - name: pod\n # expr: optional expression for prometheus + query\n # overrides the default expression \n required: false\n# - name: mono-vertex-container-cpu\n# object: mono-vertex\n# title: cpu utilization by container\n# description: cpu utilization by container for mono-vertex\n# expr: avg_over_time($metric_name{$filters}[$duration]})\n# params:\n# diff --git a/config/advanced-install/numaflow-server.yaml b/config/advanced-install/numaflow-server.yaml index 33d9401d9..2bb9165e8 100644 --- a/config/advanced-install/numaflow-server.yaml +++ b/config/advanced-install/numaflow-server.yaml @@ -216,27 +216,35 @@ data: cpu and memory utilization by pod for mono-vertex\n expr: avg_over_time($metric_name{$filters}[$duration])\n \ params:\n - name: duration\n required: true\n - name: start_time\n \ required: false\n - name: end_time\n required: false\n metrics: - \n - metric_name: namespace_pod_cpu_utilization\n display_name: CPU Utilization + \n # set your cpu metric name here\n - metric_name: namespace_pod_cpu_utilization\n + \ # set display name as per metric name\n display_name: CPU Utilization per Pod (usage seconds/resource limits)\n required_filters:\n - namespace\n - \ # to get only mono-vertex pods\n - pod \n dimensions:\n - - name: mono-vertex\n filters: \n - name: pod \n required: - false\n - metric_name: namespace_pod_memory_utilization\n display_name: - Memory Utilization per Pod (usage bytes/resource limits)\n required_filters:\n - \ - namespace\n # to get only mono-vertex pods\n - pod \n - \ dimensions:\n - name: mono-vertex\n filters: \n - - name: pod \n required: false\n- name: pipeline_vertex_cpu_memory_utilization_pod\n - \ object: vertex\n title: cpu-memory utilization by pod\n description: cpu and - memory utilization by pod for pipeline's vertex\n expr: avg_over_time($metric_name{$filters}[$duration])\n + \ - pod \n dimensions:\n - name: mono-vertex\n filters: + \n - name: pod\n # expr: optional expression for prometheus + query\n # overrides the default expression\n required: + false\n # set your memory metric name here\n - metric_name: namespace_pod_memory_utilization\n + \ # set display name as per metric name\n display_name: Memory Utilization + per Pod (usage bytes/resource limits)\n required_filters:\n - namespace\n + \ - pod \n dimensions:\n - name: mono-vertex\n filters: + \n - name: pod\n # expr: optional expression for prometheus + query\n # overrides the default expression \n required: + false\n- name: pipeline_vertex_cpu_memory_utilization_pod\n object: vertex\n + \ title: cpu-memory utilization by pod\n description: cpu and memory utilization + by pod for pipeline's vertex\n expr: avg_over_time($metric_name{$filters}[$duration])\n \ params:\n - name: duration\n required: true\n - name: start_time\n \ required: false\n - name: end_time\n required: false\n metrics: - \n - metric_name: namespace_pod_cpu_utilization\n display_name: CPU Utilization + \n # set your cpu metric name here\n - metric_name: namespace_pod_cpu_utilization\n + \ # set display name as per metric name\n display_name: CPU Utilization per Pod (usage seconds/resource limits)\n required_filters:\n - namespace\n - \ # to get only vertex pods\n - pod \n dimensions:\n - - name: vertex\n filters: \n - name: pod \n required: - false\n - metric_name: namespace_pod_memory_utilization\n display_name: - Memory Utilization per Pod (usage bytes/resource limits)\n required_filters:\n - \ - namespace\n # to get only vertex pods\n - pod \n dimensions:\n - \ - name: vertex\n filters: \n - name: pod \n required: + \ - pod \n dimensions:\n - name: vertex\n filters: + \n - name: pod\n # expr: optional expression for prometheus + query\n # overrides the default expression \n required: + false\n # set your memory metric name here\n - metric_name: namespace_pod_memory_utilization\n + \ # set display name as per metric name\n display_name: Memory Utilization + per Pod (usage bytes/resource limits)\n required_filters:\n - namespace\n + \ - pod \n dimensions:\n - name: vertex\n filters: + \n - name: pod\n # expr: optional expression for prometheus + query\n # overrides the default expression \n required: false\n# - name: mono-vertex-container-cpu\n# object: mono-vertex\n# title: cpu utilization by container\n# description: cpu utilization by container for mono-vertex\n# expr: avg_over_time($metric_name{$filters}[$duration]})\n# params:\n# diff --git a/config/base/numaflow-server/numaflow-server-metrics-proxy-config.yaml b/config/base/numaflow-server/numaflow-server-metrics-proxy-config.yaml index 9ecf5f789..b80ea149c 100644 --- a/config/base/numaflow-server/numaflow-server-metrics-proxy-config.yaml +++ b/config/base/numaflow-server/numaflow-server-metrics-proxy-config.yaml @@ -192,27 +192,33 @@ data: - name: end_time required: false metrics: + # set your cpu metric name here - metric_name: namespace_pod_cpu_utilization + # set display name as per metric name display_name: CPU Utilization per Pod (usage seconds/resource limits) required_filters: - namespace - # to get only mono-vertex pods - pod dimensions: - name: mono-vertex filters: - - name: pod + - name: pod + # expr: optional expression for prometheus query + # overrides the default expression required: false + # set your memory metric name here - metric_name: namespace_pod_memory_utilization + # set display name as per metric name display_name: Memory Utilization per Pod (usage bytes/resource limits) required_filters: - namespace - # to get only mono-vertex pods - pod dimensions: - name: mono-vertex filters: - - name: pod + - name: pod + # expr: optional expression for prometheus query + # overrides the default expression required: false - name: pipeline_vertex_cpu_memory_utilization_pod object: vertex @@ -227,27 +233,33 @@ data: - name: end_time required: false metrics: + # set your cpu metric name here - metric_name: namespace_pod_cpu_utilization + # set display name as per metric name display_name: CPU Utilization per Pod (usage seconds/resource limits) required_filters: - namespace - # to get only vertex pods - pod dimensions: - name: vertex filters: - - name: pod + - name: pod + # expr: optional expression for prometheus query + # overrides the default expression required: false + # set your memory metric name here - metric_name: namespace_pod_memory_utilization + # set display name as per metric name display_name: Memory Utilization per Pod (usage bytes/resource limits) required_filters: - namespace - # to get only vertex pods - pod dimensions: - name: vertex filters: - - name: pod + - name: pod + # expr: optional expression for prometheus query + # overrides the default expression required: false # - name: mono-vertex-container-cpu # object: mono-vertex diff --git a/config/install.yaml b/config/install.yaml index 692f173f5..ac1d000a2 100644 --- a/config/install.yaml +++ b/config/install.yaml @@ -28944,27 +28944,35 @@ data: cpu and memory utilization by pod for mono-vertex\n expr: avg_over_time($metric_name{$filters}[$duration])\n \ params:\n - name: duration\n required: true\n - name: start_time\n \ required: false\n - name: end_time\n required: false\n metrics: - \n - metric_name: namespace_pod_cpu_utilization\n display_name: CPU Utilization + \n # set your cpu metric name here\n - metric_name: namespace_pod_cpu_utilization\n + \ # set display name as per metric name\n display_name: CPU Utilization per Pod (usage seconds/resource limits)\n required_filters:\n - namespace\n - \ # to get only mono-vertex pods\n - pod \n dimensions:\n - - name: mono-vertex\n filters: \n - name: pod \n required: - false\n - metric_name: namespace_pod_memory_utilization\n display_name: - Memory Utilization per Pod (usage bytes/resource limits)\n required_filters:\n - \ - namespace\n # to get only mono-vertex pods\n - pod \n - \ dimensions:\n - name: mono-vertex\n filters: \n - - name: pod \n required: false\n- name: pipeline_vertex_cpu_memory_utilization_pod\n - \ object: vertex\n title: cpu-memory utilization by pod\n description: cpu and - memory utilization by pod for pipeline's vertex\n expr: avg_over_time($metric_name{$filters}[$duration])\n + \ - pod \n dimensions:\n - name: mono-vertex\n filters: + \n - name: pod\n # expr: optional expression for prometheus + query\n # overrides the default expression\n required: + false\n # set your memory metric name here\n - metric_name: namespace_pod_memory_utilization\n + \ # set display name as per metric name\n display_name: Memory Utilization + per Pod (usage bytes/resource limits)\n required_filters:\n - namespace\n + \ - pod \n dimensions:\n - name: mono-vertex\n filters: + \n - name: pod\n # expr: optional expression for prometheus + query\n # overrides the default expression \n required: + false\n- name: pipeline_vertex_cpu_memory_utilization_pod\n object: vertex\n + \ title: cpu-memory utilization by pod\n description: cpu and memory utilization + by pod for pipeline's vertex\n expr: avg_over_time($metric_name{$filters}[$duration])\n \ params:\n - name: duration\n required: true\n - name: start_time\n \ required: false\n - name: end_time\n required: false\n metrics: - \n - metric_name: namespace_pod_cpu_utilization\n display_name: CPU Utilization + \n # set your cpu metric name here\n - metric_name: namespace_pod_cpu_utilization\n + \ # set display name as per metric name\n display_name: CPU Utilization per Pod (usage seconds/resource limits)\n required_filters:\n - namespace\n - \ # to get only vertex pods\n - pod \n dimensions:\n - - name: vertex\n filters: \n - name: pod \n required: - false\n - metric_name: namespace_pod_memory_utilization\n display_name: - Memory Utilization per Pod (usage bytes/resource limits)\n required_filters:\n - \ - namespace\n # to get only vertex pods\n - pod \n dimensions:\n - \ - name: vertex\n filters: \n - name: pod \n required: + \ - pod \n dimensions:\n - name: vertex\n filters: + \n - name: pod\n # expr: optional expression for prometheus + query\n # overrides the default expression \n required: + false\n # set your memory metric name here\n - metric_name: namespace_pod_memory_utilization\n + \ # set display name as per metric name\n display_name: Memory Utilization + per Pod (usage bytes/resource limits)\n required_filters:\n - namespace\n + \ - pod \n dimensions:\n - name: vertex\n filters: + \n - name: pod\n # expr: optional expression for prometheus + query\n # overrides the default expression \n required: false\n# - name: mono-vertex-container-cpu\n# object: mono-vertex\n# title: cpu utilization by container\n# description: cpu utilization by container for mono-vertex\n# expr: avg_over_time($metric_name{$filters}[$duration]})\n# params:\n# diff --git a/config/namespace-install.yaml b/config/namespace-install.yaml index 021a0890f..c7682dda9 100644 --- a/config/namespace-install.yaml +++ b/config/namespace-install.yaml @@ -28832,27 +28832,35 @@ data: cpu and memory utilization by pod for mono-vertex\n expr: avg_over_time($metric_name{$filters}[$duration])\n \ params:\n - name: duration\n required: true\n - name: start_time\n \ required: false\n - name: end_time\n required: false\n metrics: - \n - metric_name: namespace_pod_cpu_utilization\n display_name: CPU Utilization + \n # set your cpu metric name here\n - metric_name: namespace_pod_cpu_utilization\n + \ # set display name as per metric name\n display_name: CPU Utilization per Pod (usage seconds/resource limits)\n required_filters:\n - namespace\n - \ # to get only mono-vertex pods\n - pod \n dimensions:\n - - name: mono-vertex\n filters: \n - name: pod \n required: - false\n - metric_name: namespace_pod_memory_utilization\n display_name: - Memory Utilization per Pod (usage bytes/resource limits)\n required_filters:\n - \ - namespace\n # to get only mono-vertex pods\n - pod \n - \ dimensions:\n - name: mono-vertex\n filters: \n - - name: pod \n required: false\n- name: pipeline_vertex_cpu_memory_utilization_pod\n - \ object: vertex\n title: cpu-memory utilization by pod\n description: cpu and - memory utilization by pod for pipeline's vertex\n expr: avg_over_time($metric_name{$filters}[$duration])\n + \ - pod \n dimensions:\n - name: mono-vertex\n filters: + \n - name: pod\n # expr: optional expression for prometheus + query\n # overrides the default expression\n required: + false\n # set your memory metric name here\n - metric_name: namespace_pod_memory_utilization\n + \ # set display name as per metric name\n display_name: Memory Utilization + per Pod (usage bytes/resource limits)\n required_filters:\n - namespace\n + \ - pod \n dimensions:\n - name: mono-vertex\n filters: + \n - name: pod\n # expr: optional expression for prometheus + query\n # overrides the default expression \n required: + false\n- name: pipeline_vertex_cpu_memory_utilization_pod\n object: vertex\n + \ title: cpu-memory utilization by pod\n description: cpu and memory utilization + by pod for pipeline's vertex\n expr: avg_over_time($metric_name{$filters}[$duration])\n \ params:\n - name: duration\n required: true\n - name: start_time\n \ required: false\n - name: end_time\n required: false\n metrics: - \n - metric_name: namespace_pod_cpu_utilization\n display_name: CPU Utilization + \n # set your cpu metric name here\n - metric_name: namespace_pod_cpu_utilization\n + \ # set display name as per metric name\n display_name: CPU Utilization per Pod (usage seconds/resource limits)\n required_filters:\n - namespace\n - \ # to get only vertex pods\n - pod \n dimensions:\n - - name: vertex\n filters: \n - name: pod \n required: - false\n - metric_name: namespace_pod_memory_utilization\n display_name: - Memory Utilization per Pod (usage bytes/resource limits)\n required_filters:\n - \ - namespace\n # to get only vertex pods\n - pod \n dimensions:\n - \ - name: vertex\n filters: \n - name: pod \n required: + \ - pod \n dimensions:\n - name: vertex\n filters: + \n - name: pod\n # expr: optional expression for prometheus + query\n # overrides the default expression \n required: + false\n # set your memory metric name here\n - metric_name: namespace_pod_memory_utilization\n + \ # set display name as per metric name\n display_name: Memory Utilization + per Pod (usage bytes/resource limits)\n required_filters:\n - namespace\n + \ - pod \n dimensions:\n - name: vertex\n filters: + \n - name: pod\n # expr: optional expression for prometheus + query\n # overrides the default expression \n required: false\n# - name: mono-vertex-container-cpu\n# object: mono-vertex\n# title: cpu utilization by container\n# description: cpu utilization by container for mono-vertex\n# expr: avg_over_time($metric_name{$filters}[$duration]})\n# params:\n# diff --git a/server/apis/v1/handler.go b/server/apis/v1/handler.go index 8f50136b1..c702d6f6b 100644 --- a/server/apis/v1/handler.go +++ b/server/apis/v1/handler.go @@ -1340,7 +1340,7 @@ func (h *handler) DiscoverMetrics(c *gin.Context) { }) } - discoveredMetrics = append(discoveredMetrics, NewDiscoveryResponse(metric.Name, metric.DisplayName, metric.Unit, dimensionData)) + discoveredMetrics = append(discoveredMetrics, NewDiscoveryResponse(pattern.Name, metric.Name, metric.DisplayName, metric.Unit, dimensionData)) } } } diff --git a/server/apis/v1/response_metrics.go b/server/apis/v1/response_metrics.go index 685e9f0d4..9eb21f84c 100644 --- a/server/apis/v1/response_metrics.go +++ b/server/apis/v1/response_metrics.go @@ -11,13 +11,14 @@ const ( ) type MetricsRequestBody struct { - MetricName string `json:"metric_name"` - Dimension string `json:"dimension"` - Filters map[string]string `json:"filters"` - Duration string `json:"duration"` - Quantile string `json:"quantile"` - StartTime string `json:"start_time"` - EndTime string `json:"end_time"` + PatternName string `json:"name"` + MetricName string `json:"metric_name"` + Dimension string `json:"dimension"` + Filters map[string]string `json:"filters"` + Duration string `json:"duration"` + Quantile string `json:"quantile"` + StartTime string `json:"start_time"` + EndTime string `json:"end_time"` } type Filter struct { diff --git a/server/apis/v1/response_metrics_discovery.go b/server/apis/v1/response_metrics_discovery.go index 9c0e09acc..2c5a65cee 100644 --- a/server/apis/v1/response_metrics_discovery.go +++ b/server/apis/v1/response_metrics_discovery.go @@ -7,6 +7,7 @@ type Dimensions struct { } type DiscoveryResponse struct { + PatternName string `json:"name"` MetricName string `json:"metric_name"` DisplayName string `json:"display_name"` Unit string `json:"unit"` @@ -17,8 +18,9 @@ type DiscoveryResponse struct { type MetricsDiscoveryResponse []DiscoveryResponse // NewDiscoveryResponse creates a new DiscoveryResponse object for each metric. -func NewDiscoveryResponse(metricName, displayName, unitName string, dimensions []Dimensions) DiscoveryResponse { +func NewDiscoveryResponse(patternName, metricName, displayName, unitName string, dimensions []Dimensions) DiscoveryResponse { return DiscoveryResponse{ + PatternName: patternName, MetricName: metricName, DisplayName: displayName, Unit: unitName, diff --git a/ui/src/components/pages/Pipeline/partials/Graph/partials/NodeInfo/partials/Pods/partials/PodDetails/partials/Metrics/partials/LineChart/index.tsx b/ui/src/components/pages/Pipeline/partials/Graph/partials/NodeInfo/partials/Pods/partials/PodDetails/partials/Metrics/partials/LineChart/index.tsx index 8054927ac..727e05941 100644 --- a/ui/src/components/pages/Pipeline/partials/Graph/partials/NodeInfo/partials/Pods/partials/PodDetails/partials/Metrics/partials/LineChart/index.tsx +++ b/ui/src/components/pages/Pipeline/partials/Graph/partials/NodeInfo/partials/Pods/partials/PodDetails/partials/Metrics/partials/LineChart/index.tsx @@ -118,6 +118,7 @@ const LineChartComponent = ({ const [chartLabels, setChartLabels] = useState([]); const [metricsReq, setMetricsReq] = useState({ metric_name: metric?.metric_name, + name: metric?.name, }); const [paramsList, setParamsList] = useState([]); // store all filters for each selected dimension @@ -215,7 +216,13 @@ const LineChartComponent = ({ filters, }); - const groupByLabel = useCallback((dimension: string, metricName: string) => { + const groupByLabel = useCallback((dimension: string, metricName: string, patternName: string) => { + switch(patternName){ + case "mono_vertex_cpu_memory_utilization_pod": + case "pipeline_vertex_cpu_memory_utilization_pod": + return ["pod"]; + } + switch (metricName) { case "monovtx_pending": case "vertex_pending_messages": @@ -236,7 +243,8 @@ const LineChartComponent = ({ const transformedData: any[] = []; const label = groupByLabel( metricsReq?.dimension, - metricsReq?.metric_name + metricsReq?.metric_name, + metricsReq?.name ); chartData?.forEach((item) => { let labelVal = "";