Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update metrics for kube state: wip #15

Open
wants to merge 2 commits into
base: update-istio-kube-state-1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions modules/prometheus/istio.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ ingester prometheus_istio_workload module {
unit = "count"

source prometheus "throughput" {
//query = "sum by (cluster, destination_canonical_service, destination_workload, destination_workload_namespace, destination_version, pod_name) (increase(istio_requests_total{reporter='source', source_canonical_service!='unknown', destination_service_name!='PassthroughCluster'}[1m]))"
query = "label_set(sum by (cluster, destination_canonical_service, destination_workload, destination_workload_namespace, destination_version, pod_name) (increase(istio_requests_total{reporter='source', source_canonical_service!='unknown', destination_service_name!='PassthroughCluster'}[1m])), 'cluster', '$input{cluster}')"
//query = "sum by (cluster, destination_canonical_service, destination_workload, destination_workload_namespace, destination_version, pod_name) (increase(istio_requests_total{reporter='destination', source_canonical_service!='unknown', destination_service_name!='PassthroughCluster'}[1m]))"
query = "label_set(sum by (cluster, destination_canonical_service, destination_workload, destination_workload_namespace, destination_version, pod_name) (increase(istio_requests_total{reporter='destination', source_canonical_service!='unknown', destination_service_name!='PassthroughCluster'}[1m])), 'cluster', '$input{cluster}')"

join_on = {
"$output{cluster}" = "$input{cluster}"
Expand All @@ -54,7 +54,7 @@ ingester prometheus_istio_workload module {
unit = "count"

source prometheus "status_2xx" {
query = "label_set(sum by (cluster, destination_canonical_service, destination_workload, destination_workload_namespace, destination_version, pod_name) (increase(istio_requests_total{reporter='source', source_canonical_service!='unknown', response_code=~'^2.*', destination_service_name!='PassthroughCluster'}[1m])), 'cluster', '$input{cluster}')"
query = "label_set(sum by (cluster, destination_canonical_service, destination_workload, destination_workload_namespace, destination_version, pod_name) (increase(istio_requests_total{reporter='destination', source_canonical_service!='unknown', response_code=~'^2.*', destination_service_name!='PassthroughCluster'}[1m])), 'cluster', '$input{cluster}')"

join_on = {
"$output{cluster}" = "$input{cluster}"
Expand All @@ -66,7 +66,7 @@ ingester prometheus_istio_workload module {
unit = "count"

source prometheus "status_3xx" {
query = "label_set(sum by (cluster, destination_canonical_service, destination_workload, destination_workload_namespace, destination_version, pod_name) (increase(istio_requests_total{reporter='source', source_canonical_service!='unknown', destination_service_name!='PassthroughCluster', response_code=~'^3.*'}[1m])), 'cluster', '$input{cluster}')"
query = "label_set(sum by (cluster, destination_canonical_service, destination_workload, destination_workload_namespace, destination_version, pod_name) (increase(istio_requests_total{reporter='destination', source_canonical_service!='unknown', destination_service_name!='PassthroughCluster', response_code=~'^3.*'}[1m])), 'cluster', '$input{cluster}')"

join_on = {
"$output{cluster}" = "$input{cluster}"
Expand All @@ -78,7 +78,7 @@ ingester prometheus_istio_workload module {
unit = "count"

source prometheus "status_4xx" {
query = "label_set(sum by (cluster, destination_canonical_service, destination_workload, destination_workload_namespace, destination_version, pod_name) (increase(istio_requests_total{reporter='source', source_canonical_service!='unknown', destination_service_name!='PassthroughCluster', response_code=~'^4.*'}[1m])), 'cluster', '$input{cluster}')"
query = "label_set(sum by (cluster, destination_canonical_service, destination_workload, destination_workload_namespace, destination_version, pod_name) (increase(istio_requests_total{reporter='destination', source_canonical_service!='unknown', destination_service_name!='PassthroughCluster', response_code=~'^4.*'}[1m])), 'cluster', '$input{cluster}')"

join_on = {
"$output{cluster}" = "$input{cluster}"
Expand All @@ -90,7 +90,7 @@ ingester prometheus_istio_workload module {
unit = "count"

source prometheus "status_5xx" {
query = "label_set(sum by (cluster, destination_canonical_service, destination_workload, destination_workload_namespace, destination_version, pod_name) (increase(istio_requests_total{reporter='source', source_canonical_service!='unknown', destination_service_name!='PassthroughCluster', response_code=~'^5.*'}[1m])), 'cluster', '$input{cluster}')"
query = "label_set(sum by (cluster, destination_canonical_service, destination_workload, destination_workload_namespace, destination_version, pod_name) (increase(istio_requests_total{reporter='destination', source_canonical_service!='unknown', destination_service_name!='PassthroughCluster', response_code=~'^5.*'}[1m])), 'cluster', '$input{cluster}')"

join_on = {
"$output{cluster}" = "$input{cluster}"
Expand Down Expand Up @@ -140,7 +140,7 @@ ingester prometheus_istio_workload module {
unit = "bytes"

source prometheus "bytes_in" {
query = "label_set(sum by (cluster, destination_canonical_service, destination_workload, destination_workload_namespace, destination_version, pod_name) (increase(istio_request_bytes_sum{reporter='source', source_canonical_service!='unknown', destination_service_name!='PassthroughCluster'}[1m])), 'cluster', '$input{cluster}')"
query = "label_set(sum by (cluster, destination_canonical_service, destination_workload, destination_workload_namespace, destination_version, pod_name) (increase(istio_request_bytes_sum{reporter='destination', source_canonical_service!='unknown', destination_service_name!='PassthroughCluster'}[1m])), 'cluster', '$input{cluster}')"

join_on = {
"$output{cluster}" = "$input{cluster}"
Expand All @@ -152,7 +152,7 @@ ingester prometheus_istio_workload module {
unit = "bytes"

source prometheus "bytes_out" {
query = "label_set(sum by (cluster, destination_canonical_service, destination_workload, destination_workload_namespace, destination_version, pod_name) (increase(istio_response_bytes_sum{reporter='source', source_canonical_service!='unknown', destination_service_name!='PassthroughCluster'}[1m])), 'cluster', '$input{cluster}')"
query = "label_set(sum by (cluster, destination_canonical_service, destination_workload, destination_workload_namespace, destination_version, pod_name) (increase(istio_response_bytes_sum{reporter='destination', source_canonical_service!='unknown', destination_service_name!='PassthroughCluster'}[1m])), 'cluster', '$input{cluster}')"

join_on = {
"$output{cluster}" = "$input{cluster}"
Expand Down Expand Up @@ -199,7 +199,7 @@ ingester prometheus_istio_cluster module {
unit = "count"

source prometheus "throughput" {
query = "label_set(sum by (cluster) (increase(istio_requests_total{reporter='source'}[1m])), 'cluster', '$input{cluster}')"
query = "label_set(sum by (cluster) (increase(istio_requests_total{reporter='destination'}[1m])), 'cluster', '$input{cluster}')"

join_on = {
"$output{cluster}" = "$input{cluster}"
Expand All @@ -211,7 +211,7 @@ ingester prometheus_istio_cluster module {
unit = "count"

source prometheus "status_2xx" {
query = "label_set(sum by (cluster) (increase(istio_requests_total{reporter='source', response_code=~'^2.*'}[1m])), 'cluster', '$input{cluster}')"
query = "label_set(sum by (cluster) (increase(istio_requests_total{reporter='destination', response_code=~'^2.*'}[1m])), 'cluster', '$input{cluster}')"

join_on = {
"$output{cluster}" = "$input{cluster}"
Expand All @@ -223,7 +223,7 @@ ingester prometheus_istio_cluster module {
unit = "count"

source prometheus "status_3xx" {
query = "label_set(sum by (cluster) (increase(istio_requests_total{reporter='source', response_code=~'^3.*'}[1m])), 'cluster', '$input{cluster}')"
query = "label_set(sum by (cluster) (increase(istio_requests_total{reporter='destination', response_code=~'^3.*'}[1m])), 'cluster', '$input{cluster}')"

join_on = {
"$output{cluster}" = "$input{cluster}"
Expand All @@ -235,7 +235,7 @@ ingester prometheus_istio_cluster module {
unit = "count"

source prometheus "status_4xx" {
query = "label_set(sum by (cluster) (increase(istio_requests_total{reporter='source', response_code=~'^4.*'}[1m])), 'cluster', '$input{cluster}')"
query = "label_set(sum by (cluster) (increase(istio_requests_total{reporter='destination', response_code=~'^4.*'}[1m])), 'cluster', '$input{cluster}')"

join_on = {
"$output{cluster}" = "$input{cluster}"
Expand All @@ -247,7 +247,7 @@ ingester prometheus_istio_cluster module {
unit = "count"

source prometheus "status_5xx" {
query = "label_set(sum by (cluster) (increase(istio_requests_total{reporter='source', response_code=~'^5.*'}[1m])), 'cluster', '$input{cluster}')"
query = "label_set(sum by (cluster) (increase(istio_requests_total{reporter='destination', response_code=~'^5.*'}[1m])), 'cluster', '$input{cluster}')"

join_on = {
"$output{cluster}" = "$input{cluster}"
Expand All @@ -259,7 +259,7 @@ ingester prometheus_istio_cluster module {
unit = "bytes"

source prometheus "bytes_in" {
query = "label_set(sum by (cluster) (increase(istio_request_bytes_sum{reporter='source'}[1m])), 'cluster', '$input{cluster}')"
query = "label_set(sum by (cluster) (increase(istio_request_bytes_sum{reporter='destination'}[1m])), 'cluster', '$input{cluster}')"

join_on = {
"$output{cluster}" = "$input{cluster}"
Expand All @@ -271,7 +271,7 @@ ingester prometheus_istio_cluster module {
unit = "bytes"

source prometheus "bytes_out" {
query = "label_set(sum by (cluster) (increase(istio_response_bytes_sum{reporter='source'}[1m])), 'cluster', '$input{cluster}')"
query = "label_set(sum by (cluster) (increase(istio_response_bytes_sum{reporter='destination'}[1m])), 'cluster', '$input{cluster}')"

join_on = {
"$output{cluster}" = "$input{cluster}"
Expand Down Expand Up @@ -338,7 +338,7 @@ ingester prometheus_istio_k8s_pod module {
unit = "count"

source prometheus "throughput" {
query = "label_set(sum by (cluster, pod_name, destination_canonical_service, destination_workload_namespace) (increase(istio_requests_total{reporter='source', destination_service_name!='PassthroughCluster', source_canonical_service!='unknown'}[1m])), 'cluster', '$input{cluster}')"
query = "label_set(sum by (cluster, pod_name, destination_canonical_service, destination_workload_namespace) (increase(istio_requests_total{reporter='destination', destination_service_name!='PassthroughCluster', source_canonical_service!='unknown'}[1m])), 'cluster', '$input{cluster}')"

join_on = {
"$output{cluster}" = "$input{cluster}"
Expand All @@ -350,7 +350,7 @@ ingester prometheus_istio_k8s_pod module {
unit = "count"

source prometheus "status_2xx" {
query = "label_set(sum by (cluster, pod_name, destination_canonical_service, destination_workload_namespace) (increase(istio_requests_total{reporter='source', destination_service_name!='PassthroughCluster', source_canonical_service!='unknown', response_code=~'^2.*'}[1m])), 'cluster', '$input{cluster}')"
query = "label_set(sum by (cluster, pod_name, destination_canonical_service, destination_workload_namespace) (increase(istio_requests_total{reporter='destination', destination_service_name!='PassthroughCluster', source_canonical_service!='unknown', response_code=~'^2.*'}[1m])), 'cluster', '$input{cluster}')"

join_on = {
"$output{cluster}" = "$input{cluster}"
Expand All @@ -362,7 +362,7 @@ ingester prometheus_istio_k8s_pod module {
unit = "count"

source prometheus "status_3xx" {
query = "label_set(sum by (cluster, pod_name, destination_canonical_service, destination_workload_namespace) (increase(istio_requests_total{reporter='source', destination_service_name!='PassthroughCluster', source_canonical_service!='unknown', response_code=~'^3.*'}[1m])), 'cluster', '$input{cluster}')"
query = "label_set(sum by (cluster, pod_name, destination_canonical_service, destination_workload_namespace) (increase(istio_requests_total{reporter='destination', destination_service_name!='PassthroughCluster', source_canonical_service!='unknown', response_code=~'^3.*'}[1m])), 'cluster', '$input{cluster}')"

join_on = {
"$output{cluster}" = "$input{cluster}"
Expand All @@ -374,7 +374,7 @@ ingester prometheus_istio_k8s_pod module {
unit = "count"

source prometheus "status_4xx" {
query = "label_set(sum by (cluster, pod_name, destination_canonical_service, destination_workload_namespace) (increase(istio_requests_total{reporter='source', destination_service_name!='PassthroughCluster', source_canonical_service!='unknown', response_code=~'^4.*'}[1m])), 'cluster', '$input{cluster}')"
query = "label_set(sum by (cluster, pod_name, destination_canonical_service, destination_workload_namespace) (increase(istio_requests_total{reporter='destination', destination_service_name!='PassthroughCluster', source_canonical_service!='unknown', response_code=~'^4.*'}[1m])), 'cluster', '$input{cluster}')"

join_on = {
"$output{cluster}" = "$input{cluster}"
Expand All @@ -386,7 +386,7 @@ ingester prometheus_istio_k8s_pod module {
unit = "count"

source prometheus "status_5xx" {
query = "label_set(sum by (cluster, pod_name, destination_canonical_service, destination_workload_namespace) (increase(istio_requests_total{reporter='source', destination_service_name!='PassthroughCluster', source_canonical_service!='unknown', response_code=~'^5.*'}[1m])), 'cluster', '$input{cluster}')"
query = "label_set(sum by (cluster, pod_name, destination_canonical_service, destination_workload_namespace) (increase(istio_requests_total{reporter='destination', destination_service_name!='PassthroughCluster', source_canonical_service!='unknown', response_code=~'^5.*'}[1m])), 'cluster', '$input{cluster}')"

join_on = {
"$output{cluster}" = "$input{cluster}"
Expand All @@ -398,7 +398,7 @@ ingester prometheus_istio_k8s_pod module {
unit = "bytes"

source prometheus "bytes_in" {
query = "label_set(sum by (cluster, pod_name, destination_canonical_service, destination_workload_namespace) (increase(istio_request_bytes_sum{reporter='source', destination_service_name!='PassthroughCluster', source_canonical_service!='unknown'}[1m])), 'cluster', '$input{cluster}')"
query = "label_set(sum by (cluster, pod_name, destination_canonical_service, destination_workload_namespace) (increase(istio_request_bytes_sum{reporter='destination', destination_service_name!='PassthroughCluster', source_canonical_service!='unknown'}[1m])), 'cluster', '$input{cluster}')"

join_on = {
"$output{cluster}" = "$input{cluster}"
Expand All @@ -410,7 +410,7 @@ ingester prometheus_istio_k8s_pod module {
unit = "bytes"

source prometheus "bytes_out" {
query = "label_set(sum by (cluster, pod_name, destination_canonical_service, destination_workload_namespace) (increase(istio_response_bytes_sum{reporter='source', destination_service_name!='PassthroughCluster', source_canonical_service!='unknown'}[1m])), 'cluster', '$input{cluster}')"
query = "label_set(sum by (cluster, pod_name, destination_canonical_service, destination_workload_namespace) (increase(istio_response_bytes_sum{reporter='destination', destination_service_name!='PassthroughCluster', source_canonical_service!='unknown'}[1m])), 'cluster', '$input{cluster}')"

join_on = {
"$output{cluster}" = "$input{cluster}"
Expand Down
Loading