Skip to content

Commit

Permalink
Use $__rate_inteval in Thanos mixin dashboards (thanos-io#6052)
Browse files Browse the repository at this point in the history
This PR changes the Thanos mixin dashboard widgets that are using
the rate function from $interval magic variable to __rate_interval.

It has been added in Grafana 7.2 for that exact purpose.

Signed-off-by: Daniel Mellado <dmellado@redhat.com>

Signed-off-by: Daniel Mellado <dmellado@redhat.com>
  • Loading branch information
danielmellado authored and sshantel committed Jan 28, 2023
1 parent a587e52 commit 103bea4
Show file tree
Hide file tree
Showing 15 changed files with 112 additions and 112 deletions.
12 changes: 6 additions & 6 deletions examples/dashboards/bucket-replicate.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
"steppedLine": false,
"targets": [
{
"expr": "sum by (job, result) (rate(thanos_replicate_replication_runs_total{result=\"error\", job=~\"$job\"}[$interval]))",
"expr": "sum by (job, result) (rate(thanos_replicate_replication_runs_total{result=\"error\", job=~\"$job\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "{{result}}",
Expand Down Expand Up @@ -329,39 +329,39 @@
"steppedLine": false,
"targets": [
{
"expr": "sum by (job) (rate(blocks_meta_synced{state=\"loaded\", job=~\"$job\"}[$interval]))",
"expr": "sum by (job) (rate(blocks_meta_synced{state=\"loaded\", job=~\"$job\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "meta loads",
"legendLink": null,
"step": 10
},
{
"expr": "sum by (job) (rate(blocks_meta_synced{state=\"failed\", job=~\"$job\"}[$interval]))",
"expr": "sum by (job) (rate(blocks_meta_synced{state=\"failed\", job=~\"$job\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "partial meta reads",
"legendLink": null,
"step": 10
},
{
"expr": "sum by (job) (rate(thanos_replicate_blocks_already_replicated_total{job=~\"$job\"}[$interval]))",
"expr": "sum by (job) (rate(thanos_replicate_blocks_already_replicated_total{job=~\"$job\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "already replicated blocks",
"legendLink": null,
"step": 10
},
{
"expr": "sum by (job) (rate(thanos_replicate_blocks_replicated_total{job=~\"$job\"}[$interval]))",
"expr": "sum by (job) (rate(thanos_replicate_blocks_replicated_total{job=~\"$job\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "replicated blocks",
"legendLink": null,
"step": 10
},
{
"expr": "sum by (job) (rate(thanos_replicate_objects_replicated_total{job=~\"$job\"}[$interval]))",
"expr": "sum by (job) (rate(thanos_replicate_objects_replicated_total{job=~\"$job\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "replicated objects",
Expand Down
16 changes: 8 additions & 8 deletions examples/dashboards/compact.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"steppedLine": false,
"targets": [
{
"expr": "sum by (job, group) (rate(thanos_compact_group_compactions_total{job=~\"$job\"}[$interval]))",
"expr": "sum by (job, group) (rate(thanos_compact_group_compactions_total{job=~\"$job\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "compaction {{job}} {{group}}",
Expand Down Expand Up @@ -213,7 +213,7 @@
"steppedLine": false,
"targets": [
{
"expr": "sum by (job, group) (rate(thanos_compact_downsample_total{job=~\"$job\"}[$interval]))",
"expr": "sum by (job, group) (rate(thanos_compact_downsample_total{job=~\"$job\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "downsample {{job}} {{group}}",
Expand Down Expand Up @@ -380,7 +380,7 @@
"steppedLine": false,
"targets": [
{
"expr": "sum by (job) (rate(thanos_compact_garbage_collection_total{job=~\"$job\"}[$interval]))",
"expr": "sum by (job) (rate(thanos_compact_garbage_collection_total{job=~\"$job\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "garbage collection {{job}}",
Expand Down Expand Up @@ -665,7 +665,7 @@
"steppedLine": false,
"targets": [
{
"expr": "sum by (job) (rate(thanos_compact_blocks_cleaned_total{job=~\"$job\"}[$interval]))",
"expr": "sum by (job) (rate(thanos_compact_blocks_cleaned_total{job=~\"$job\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "Blocks cleanup {{job}}",
Expand Down Expand Up @@ -742,7 +742,7 @@
"steppedLine": false,
"targets": [
{
"expr": "sum by (job) (rate(thanos_compact_block_cleanup_failures_total{job=~\"$job\"}[$interval]))",
"expr": "sum by (job) (rate(thanos_compact_block_cleanup_failures_total{job=~\"$job\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "Blocks cleanup failures {{job}}",
Expand Down Expand Up @@ -819,7 +819,7 @@
"steppedLine": false,
"targets": [
{
"expr": "sum by (job) (rate(thanos_compact_blocks_marked_for_deletion_total{job=~\"$job\"}[$interval]))",
"expr": "sum by (job) (rate(thanos_compact_blocks_marked_for_deletion_total{job=~\"$job\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "Blocks marked {{job}}",
Expand Down Expand Up @@ -908,7 +908,7 @@
"steppedLine": false,
"targets": [
{
"expr": "sum by (job) (rate(thanos_blocks_meta_syncs_total{job=~\"$job\"}[$interval]))",
"expr": "sum by (job) (rate(thanos_blocks_meta_syncs_total{job=~\"$job\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "sync {{job}}",
Expand Down Expand Up @@ -1193,7 +1193,7 @@
"steppedLine": false,
"targets": [
{
"expr": "sum by (job, operation) (rate(thanos_objstore_bucket_operations_total{job=~\"$job\"}[$interval]))",
"expr": "sum by (job, operation) (rate(thanos_objstore_bucket_operations_total{job=~\"$job\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "{{job}} {{operation}}",
Expand Down
4 changes: 2 additions & 2 deletions examples/dashboards/overview.json
Original file line number Diff line number Diff line change
Expand Up @@ -1683,7 +1683,7 @@
"steppedLine": false,
"targets": [
{
"expr": "sum by (job, alertmanager) (rate(thanos_alert_sender_alerts_sent_total{}[$interval]))",
"expr": "sum by (job, alertmanager) (rate(thanos_alert_sender_alerts_sent_total{}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "{{alertmanager}}",
Expand Down Expand Up @@ -1968,7 +1968,7 @@
"steppedLine": false,
"targets": [
{
"expr": "sum by (job) (rate(thanos_compact_group_compactions_total{}[$interval]))",
"expr": "sum by (job) (rate(thanos_compact_group_compactions_total{}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "compaction {{job}}",
Expand Down
10 changes: 5 additions & 5 deletions examples/dashboards/query-frontend.json
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@
"steppedLine": false,
"targets": [
{
"expr": "sum by (job, tripperware) (rate(cortex_cache_request_duration_seconds_count{job=~\"$job\"}[$interval]))",
"expr": "sum by (job, tripperware) (rate(cortex_cache_request_duration_seconds_count{job=~\"$job\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "{{job}} {{tripperware}}",
Expand Down Expand Up @@ -525,15 +525,15 @@
"steppedLine": false,
"targets": [
{
"expr": "sum by (job, tripperware) (rate(querier_cache_gets_total{job=~\"$job\"}[$interval]))",
"expr": "sum by (job, tripperware) (rate(querier_cache_gets_total{job=~\"$job\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "Cache gets - {{job}} {{tripperware}}",
"legendLink": null,
"step": 10
},
{
"expr": "sum by (job, tripperware) (rate(querier_cache_misses_total{job=~\"$job\"}[$interval]))",
"expr": "sum by (job, tripperware) (rate(querier_cache_misses_total{job=~\"$job\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "Cache misses - {{job}} {{tripperware}}",
Expand Down Expand Up @@ -610,7 +610,7 @@
"steppedLine": false,
"targets": [
{
"expr": "sum by (job, tripperware) (rate(cortex_cache_fetched_keys_total{job=~\"$job\"}[$interval]))",
"expr": "sum by (job, tripperware) (rate(cortex_cache_fetched_keys_total{job=~\"$job\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "{{job}} {{tripperware}}",
Expand Down Expand Up @@ -687,7 +687,7 @@
"steppedLine": false,
"targets": [
{
"expr": "sum by (job, tripperware) (rate(cortex_cache_hits_total{job=~\"$job\"}[$interval]))",
"expr": "sum by (job, tripperware) (rate(cortex_cache_hits_total{job=~\"$job\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "{{job}} {{tripperware}}",
Expand Down
22 changes: 11 additions & 11 deletions examples/dashboards/receive.json
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@
"steppedLine": false,
"targets": [
{
"expr": "sum by (tenant, code) (rate(http_requests_total{job=~\"$job\", tenant=~\"$tenant\", handler=\"receive\"}[$interval]))",
"expr": "sum by (tenant, code) (rate(http_requests_total{job=~\"$job\", tenant=~\"$tenant\", handler=\"receive\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "{{code}} - {{tenant}}",
Expand Down Expand Up @@ -426,7 +426,7 @@
"steppedLine": false,
"targets": [
{
"expr": "sum by (tenant, code) (rate(http_requests_total{job=~\"$job\", tenant=~\"$tenant\", handler=\"receive\", code!~\"2..\"}[$interval]))",
"expr": "sum by (tenant, code) (rate(http_requests_total{job=~\"$job\", tenant=~\"$tenant\", handler=\"receive\", code!~\"2..\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "{{code}} - {{tenant}}",
Expand Down Expand Up @@ -502,7 +502,7 @@
"steppedLine": false,
"targets": [
{
"expr": "sum by (job, tenant) (rate(http_request_duration_seconds_sum{job=~\"$job\", tenant=~\"$tenant\", handler=\"receive\"}[$interval])) / sum by (job, tenant) (http_request_duration_seconds_count{job=~\"$job\", tenant=~\"$tenant\", handler=\"receive\"})",
"expr": "sum by (job, tenant) (rate(http_request_duration_seconds_sum{job=~\"$job\", tenant=~\"$tenant\", handler=\"receive\"}[$__rate_interval])) / sum by (job, tenant) (http_request_duration_seconds_count{job=~\"$job\", tenant=~\"$tenant\", handler=\"receive\"})",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "{{tenant}}",
Expand Down Expand Up @@ -590,7 +590,7 @@
"steppedLine": false,
"targets": [
{
"expr": "sum by (job, tenant) (rate(http_request_size_bytes_sum{job=~\"$job\", tenant=~\"$tenant\", handler=\"receive\", code=~\"2..\"}[$interval])) / sum by (job, tenant) (rate(http_request_size_bytes_count{job=~\"$job\", tenant=~\"$tenant\", handler=\"receive\", code=~\"2..\"}[$interval]))",
"expr": "sum by (job, tenant) (rate(http_request_size_bytes_sum{job=~\"$job\", tenant=~\"$tenant\", handler=\"receive\", code=~\"2..\"}[$__rate_interval])) / sum by (job, tenant) (rate(http_request_size_bytes_count{job=~\"$job\", tenant=~\"$tenant\", handler=\"receive\", code=~\"2..\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "{{tenant}}",
Expand Down Expand Up @@ -666,7 +666,7 @@
"steppedLine": false,
"targets": [
{
"expr": "sum by (job, tenant) (rate(http_request_size_bytes_sum{job=~\"$job\", tenant=~\"$tenant\", handler=\"receive\", code!~\"2..\"}[$interval])) / sum by (job, tenant) (rate(http_request_size_bytes_count{job=~\"$job\", tenant=~\"$tenant\", handler=\"receive\", code!~\"2..\"}[$interval]))",
"expr": "sum by (job, tenant) (rate(http_request_size_bytes_sum{job=~\"$job\", tenant=~\"$tenant\", handler=\"receive\", code!~\"2..\"}[$__rate_interval])) / sum by (job, tenant) (rate(http_request_size_bytes_count{job=~\"$job\", tenant=~\"$tenant\", handler=\"receive\", code!~\"2..\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "{{tenant}}",
Expand Down Expand Up @@ -830,7 +830,7 @@
"steppedLine": false,
"targets": [
{
"expr": "sum(rate(thanos_receive_write_timeseries_bucket{job=~\"$job\", tenant=~\"$tenant\", code=~\"2..\"}[$interval])) by (job, tenant) ",
"expr": "sum(rate(thanos_receive_write_timeseries_bucket{job=~\"$job\", tenant=~\"$tenant\", code=~\"2..\"}[$__rate_interval])) by (job, tenant) ",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "{{tenant}}",
Expand Down Expand Up @@ -906,7 +906,7 @@
"steppedLine": false,
"targets": [
{
"expr": "sum(rate(thanos_receive_write_timeseries_bucket{job=~\"$job\", tenant=~\"$tenant\", code!~\"2..\"}[$interval])) by (tenant, code) ",
"expr": "sum(rate(thanos_receive_write_timeseries_bucket{job=~\"$job\", tenant=~\"$tenant\", code!~\"2..\"}[$__rate_interval])) by (tenant, code) ",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "{{code}} - {{tenant}}",
Expand Down Expand Up @@ -982,7 +982,7 @@
"steppedLine": false,
"targets": [
{
"expr": "sum(rate(thanos_receive_write_samples_sum{job=~\"$job\", tenant=~\"$tenant\", code=~\"2..\"}[$interval])) by (job, tenant) ",
"expr": "sum(rate(thanos_receive_write_samples_sum{job=~\"$job\", tenant=~\"$tenant\", code=~\"2..\"}[$__rate_interval])) by (job, tenant) ",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "{{tenant}}",
Expand Down Expand Up @@ -1058,7 +1058,7 @@
"steppedLine": false,
"targets": [
{
"expr": "sum(rate(thanos_receive_write_samples_sum{job=~\"$job\", tenant=~\"$tenant\", code!~\"2..\"}[$interval])) by (tenant, code) ",
"expr": "sum(rate(thanos_receive_write_samples_sum{job=~\"$job\", tenant=~\"$tenant\", code!~\"2..\"}[$__rate_interval])) by (tenant, code) ",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "{{code}} - {{tenant}}",
Expand Down Expand Up @@ -1147,7 +1147,7 @@
"steppedLine": false,
"targets": [
{
"expr": "sum by (job) (rate(thanos_receive_replications_total{job=~\"$job\"}[$interval]))",
"expr": "sum by (job) (rate(thanos_receive_replications_total{job=~\"$job\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "all {{job}}",
Expand Down Expand Up @@ -1314,7 +1314,7 @@
"steppedLine": false,
"targets": [
{
"expr": "sum by (job) (rate(thanos_receive_forward_requests_total{job=~\"$job\"}[$interval]))",
"expr": "sum by (job) (rate(thanos_receive_forward_requests_total{job=~\"$job\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "all {{job}}",
Expand Down
Loading

0 comments on commit 103bea4

Please sign in to comment.