Skip to content

Commit

Permalink
tsuru-monitoring: Use pod instead of pod_name in rules
Browse files Browse the repository at this point in the history
  • Loading branch information
cezarsa committed Jun 10, 2021
1 parent 706f610 commit 3c03dbe
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 17 deletions.
8 changes: 1 addition & 7 deletions charts/tsuru-monitoring/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,4 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.1.0"
version: 0.1.2
8 changes: 4 additions & 4 deletions charts/tsuru-monitoring/templates/tsuru-apps-rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ spec:
rules:
- record: tsuru:apps_cpu_usage_seconds_total
expr: |
container_cpu_usage_seconds_total{container="", pod_name!=""} *
on (pod_name) group_left(label_tsuru_io_app_name, label_version, label_tsuru_io_app_process) label_replace(kube_pod_labels{label_tsuru_io_is_tsuru="true"}, "pod_name", "$1", "pod", "(.*)")
container_cpu_usage_seconds_total{container!="POD", container!="", pod!=""} *
on (pod) group_left(label_tsuru_io_app_name, label_version, label_tsuru_io_app_process, label_tsuru_io_app_pool) kube_pod_labels{label_tsuru_io_is_tsuru="true"}
- record: tsuru:apps_memory_working_set_bytes
expr: |
container_memory_working_set_bytes{pod_name!="", container=""} *
on (pod_name) group_left(label_tsuru_io_app_name, label_version, label_tsuru_io_app_process) label_replace(kube_pod_labels{label_tsuru_io_is_tsuru="true"}, "pod_name", "$1", "pod", "(.*)")
container_memory_working_set_bytes{container!="POD", container!="", pod!=""} *
on (pod) group_left(label_tsuru_io_app_name, label_version, label_tsuru_io_app_process, label_tsuru_io_app_pool) kube_pod_labels{label_tsuru_io_is_tsuru="true"}
12 changes: 6 additions & 6 deletions charts/tsuru-monitoring/templates/tsuru-rpaas-rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,27 @@ spec:
name: tsuru-rpaas.rules
rules:
- expr: |
container_memory_working_set_bytes{} * on(pod_name) group_left(label_rpaas_service, label_rpaas_instance) label_replace(kube_pod_labels{label_nginx_tsuru_io_app="nginx"}, "pod_name", "$1", "pod", "(.*)")
container_memory_working_set_bytes{} * on(pod) group_left(label_rpaas_service, label_rpaas_instance) kube_pod_labels{label_nginx_tsuru_io_app="nginx"}
record: "rpaas:container_memory_working_set_bytes"
- expr: |
container_cpu_usage_seconds_total{} * on(pod_name) group_left(label_rpaas_service, label_rpaas_instance) label_replace(kube_pod_labels{label_nginx_tsuru_io_app="nginx"}, "pod_name", "$1", "pod", "(.*)")
container_cpu_usage_seconds_total{} * on(pod) group_left(label_rpaas_service, label_rpaas_instance) kube_pod_labels{label_nginx_tsuru_io_app="nginx"}
record: "rpaas:container_cpu_usage_seconds_total"
- expr: |
container_network_receive_bytes_total{} * on(pod_name) group_left(label_rpaas_service, label_rpaas_instance) label_replace(kube_pod_labels{label_nginx_tsuru_io_app="nginx"}, "pod_name", "$1", "pod", "(.*)")
container_network_receive_bytes_total{} * on(pod) group_left(label_rpaas_service, label_rpaas_instance) kube_pod_labels{label_nginx_tsuru_io_app="nginx"}
record: "rpaas:container_network_receive_bytes_total"
- expr: |
container_network_transmit_bytes_total{} * on(pod_name) group_left(label_rpaas_service, label_rpaas_instance) label_replace(kube_pod_labels{label_nginx_tsuru_io_app="nginx"}, "pod_name", "$1", "pod", "(.*)")
container_network_transmit_bytes_total{} * on(pod) group_left(label_rpaas_service, label_rpaas_instance) kube_pod_labels{label_nginx_tsuru_io_app="nginx"}
record: "rpaas:container_network_transmit_bytes_total"
- expr: |
container_cpu_load_average_10s{} * on(pod_name) group_left(label_rpaas_service, label_rpaas_instance) label_replace(kube_pod_labels{label_nginx_tsuru_io_app="nginx"}, "pod_name", "$1", "pod", "(.*)")
container_cpu_load_average_10s{} * on(pod) group_left(label_rpaas_service, label_rpaas_instance) kube_pod_labels{label_nginx_tsuru_io_app="nginx"}
record: "rpaas:container_cpu_load_average_10s"
- expr: |
container_spec_memory_limit_bytes{} * on(pod_name) group_left(label_rpaas_service, label_rpaas_instance) label_replace(kube_pod_labels{label_nginx_tsuru_io_app="nginx"}, "pod_name", "$1", "pod", "(.*)")
container_spec_memory_limit_bytes{} * on(pod) group_left(label_rpaas_service, label_rpaas_instance) kube_pod_labels{label_nginx_tsuru_io_app="nginx"}
record: "rpaas:container_spec_memory_limit_bytes"
- expr: |
Expand Down

0 comments on commit 3c03dbe

Please sign in to comment.