Skip to content

Commit

Permalink
Use record created for container_network metrics
Browse files Browse the repository at this point in the history
This commit updates the container_network pod metrics
to use the newly introduced recording rules in the
CMO repository.
Ref: openshift/cluster-monitoring-operator#2314
  • Loading branch information
mansikulkarni96 committed Apr 16, 2024
1 parent d22389e commit 7a69afe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ const podMetricsQueries = {
"pod:container_fs_usage_bytes:sum{pod='<%= name %>'}",
),
[ResourceUtilizationQuery.NETWORK_IN]: _.template(
"(sum(irate(container_network_receive_bytes_total{pod='<%= name %>'}[5m])) by (pod, interface)) + on(pod,interface) group_left(network_name) (pod_network_name_info)",
"pod_interface_network:container_network_receive_bytes:irate5m{pod='<%= name %>'}",
),
[ResourceUtilizationQuery.NETWORK_OUT]: _.template(
"(sum(irate(container_network_transmit_bytes_total{pod='<%= name %>'}[5m])) by (pod, interface)) + on(pod,interface) group_left(network_name) (pod_network_name_info)",
"pod_interface_network:container_network_transmit_bytes_total:irate5m{pod='<%= name %>'}",
),
[ResourceUtilizationQuery.QUOTA_LIMIT]: _.template(
"sum by (pod, resource) (kube_pod_resource_limit{resource='<%= resource %>',pod='<%= name %>'})",
Expand Down
4 changes: 2 additions & 2 deletions frontend/public/components/pod.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ const PodMetrics: React.FC<PodMetricsProps> = ({ obj }) => {
ariaChartLinkLabel={t('public~View in query browser')}
humanize={humanizeDecimalBytesPerSec}
namespace={obj.metadata.namespace}
query={`(sum(irate(container_network_receive_bytes_total{pod='${obj.metadata.name}', namespace='${obj.metadata.namespace}'}[5m])) by (pod, namespace, interface)) + on(namespace,pod,interface) group_left(network_name) (pod_network_name_info)`}
query={`pod_interface_network:container_network_receive_bytes:irate5m{pod='${obj.metadata.name}', namespace='${obj.metadata.namespace}'}`}
description={getNetworkName}
/>
</CardBody>
Expand All @@ -700,7 +700,7 @@ const PodMetrics: React.FC<PodMetricsProps> = ({ obj }) => {
ariaChartLinkLabel={t('public~View in query browser')}
humanize={humanizeDecimalBytesPerSec}
namespace={obj.metadata.namespace}
query={`(sum(irate(container_network_transmit_bytes_total{pod='${obj.metadata.name}', namespace='${obj.metadata.namespace}'}[5m])) by (pod, namespace, interface)) + on(namespace,pod,interface) group_left(network_name) (pod_network_name_info)`}
query={`pod_interface_network:container_network_transmit_bytes_total:irate5m{pod='${obj.metadata.name}', namespace='${obj.metadata.namespace}'}`}
description={getNetworkName}
/>
</CardBody>
Expand Down

0 comments on commit 7a69afe

Please sign in to comment.