Skip to content

Commit

Permalink
Fix rate()/irate() Hono dashboard queries.
Browse files Browse the repository at this point in the history
- Replace $__range with $__rate_interval. If a Hono protocol adapter pod gets deleted
 and a new one gets started, a large chart time range would otherwise result in an
 equally large period being displayed with wrong (doubled) chart values.
- Replace $__interval with $__rate_interval. This prevents empty rate/irate() results
 in case of a short range (with not enough data points in $__interval) being displayed.

Signed-off-by: Carsten Lohmann <[email protected]>
  • Loading branch information
calohmn committed Sep 29, 2021
1 parent 7a5f26b commit 721c077
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 33 deletions.
2 changes: 1 addition & 1 deletion charts/hono/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ name: hono
description: |
Eclipse Hono™ provides remote service interfaces for connecting large numbers of IoT devices to a back end and
interacting with them in a uniform way regardless of the device communication protocol.
version: 1.10.0
version: 1.10.1
# Version of Hono being deployed by the chart
appVersion: 1.9.1
keywords:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,14 +263,14 @@
"steppedLine": false,
"targets": [
{
"expr": "sum(rate(jvm_gc_pause_seconds_sum{host=~\"$instance\"}[$__interval]))",
"expr": "sum(rate(jvm_gc_pause_seconds_sum{host=~\"$instance\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "GC Pause - {{host}}",
"refId": "A"
},
{
"expr": "rate(jvm_gc_memory_promoted_bytes_total{host=~\"$instance\"}[$__interval])",
"expr": "rate(jvm_gc_memory_promoted_bytes_total{host=~\"$instance\"}[$__rate_interval])",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "Allocated - {{host}}",
Expand Down Expand Up @@ -745,7 +745,7 @@
"steppedLine": false,
"targets": [
{
"expr": "rate(logback_events_total{host=~\"$instance\"}[$__interval])",
"expr": "rate(logback_events_total{host=~\"$instance\"}[$__rate_interval])",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "{{level}} - {{host}}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
"tableColumn": "",
"targets": [
{
"expr": "sum(rate(hono_messages_received_seconds_count{status=\"forwarded\",component_name=~\"$componentname\",type=~\"$type\",tenant=~\"$tenant\",host=~\"$instance\"}[$__interval]))",
"expr": "sum(rate(hono_messages_received_seconds_count{status=\"forwarded\",component_name=~\"$componentname\",type=~\"$type\",tenant=~\"$tenant\",host=~\"$instance\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 1,
"refId": "A"
Expand Down Expand Up @@ -247,7 +247,7 @@
"tableColumn": "",
"targets": [
{
"expr": "sum(rate(hono_messages_received_seconds_count{status=\"forwarded\",component_name=~\"$componentname\",type=~\"$type\",tenant=~\"$tenant\",host=~\"$instance\"}[$__interval]))",
"expr": "sum(rate(hono_messages_received_seconds_count{status=\"forwarded\",component_name=~\"$componentname\",type=~\"$type\",tenant=~\"$tenant\",host=~\"$instance\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 1,
"refId": "A"
Expand Down Expand Up @@ -328,7 +328,7 @@
"tableColumn": "",
"targets": [
{
"expr": "sum(rate(hono_messages_received_seconds_count{status=\"forwarded\",component_name=~\"$componentname\",type=~\"$type\",tenant=~\"$tenant\",host=~\"$instance\"}[$__interval]))",
"expr": "sum(rate(hono_messages_received_seconds_count{status=\"forwarded\",component_name=~\"$componentname\",type=~\"$type\",tenant=~\"$tenant\",host=~\"$instance\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 1,
"refId": "A"
Expand Down Expand Up @@ -509,7 +509,7 @@
"tableColumn": "",
"targets": [
{
"expr": "sum(rate(hono_messages_payload_bytes_sum{component_name=~\"$componentname\",type=~\"$type\",tenant=~\"$tenant\",host=~\"$instance\"}[$__interval]))",
"expr": "sum(rate(hono_messages_payload_bytes_sum{component_name=~\"$componentname\",type=~\"$type\",tenant=~\"$tenant\",host=~\"$instance\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 1,
"refId": "A"
Expand Down Expand Up @@ -590,7 +590,7 @@
"tableColumn": "",
"targets": [
{
"expr": "sum(rate(hono_messages_payload_bytes_sum{component_name=~\"$componentname\",type=~\"$type\",tenant=~\"$tenant\",host=~\"$instance\"}[$__interval]))",
"expr": "sum(rate(hono_messages_payload_bytes_sum{component_name=~\"$componentname\",type=~\"$type\",tenant=~\"$tenant\",host=~\"$instance\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 1,
"refId": "A"
Expand Down Expand Up @@ -671,7 +671,7 @@
"tableColumn": "",
"targets": [
{
"expr": "sum(rate(hono_messages_payload_bytes_sum{component_name=~\"$componentname\",type=~\"$type\",tenant=~\"$tenant\",host=~\"$instance\"}[$__interval]))",
"expr": "sum(rate(hono_messages_payload_bytes_sum{component_name=~\"$componentname\",type=~\"$type\",tenant=~\"$tenant\",host=~\"$instance\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 1,
"refId": "A"
Expand Down Expand Up @@ -846,7 +846,7 @@
"tableColumn": "",
"targets": [
{
"expr": "(sum(rate(hono_messages_received_seconds_count{component_name=~\"$componentname\",type=~\"$type\",status!=\"forwarded\",tenant=~\"$tenant\",host=~\"$instance\"}[$__interval]))\n/\n sum(rate(hono_messages_received_seconds_count{component_name=~\"$componentname\",type=~\"$type\",tenant=~\"$tenant\",host=~\"$instance\"}[$__interval])))\n* 100\n",
"expr": "(sum(rate(hono_messages_received_seconds_count{component_name=~\"$componentname\",type=~\"$type\",status!=\"forwarded\",tenant=~\"$tenant\",host=~\"$instance\"}[$__rate_interval]))\n/\n sum(rate(hono_messages_received_seconds_count{component_name=~\"$componentname\",type=~\"$type\",tenant=~\"$tenant\",host=~\"$instance\"}[$__rate_interval])))\n* 100\n",
"format": "time_series",
"instant": false,
"intervalFactor": 1,
Expand Down
44 changes: 22 additions & 22 deletions charts/hono/config/grafana/dashboard-definitions/overview.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,21 +139,21 @@
"steppedLine": false,
"targets": [
{
"expr": "sum(irate(hono_messages_received_seconds_count{type=\"telemetry\",status=\"unprocessable\"}[$__range]))",
"expr": "sum(irate(hono_messages_received_seconds_count{type=\"telemetry\",status=\"unprocessable\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "unprocessable",
"refId": "C"
},
{
"expr": "sum(irate(hono_messages_received_seconds_count{type=\"telemetry\",status=\"undeliverable\"}[$__range]))",
"expr": "sum(irate(hono_messages_received_seconds_count{type=\"telemetry\",status=\"undeliverable\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "undeliverable",
"refId": "B"
},
{
"expr": "sum(irate(hono_messages_received_seconds_count{type=\"telemetry\",status=\"forwarded\"}[$__range]))",
"expr": "sum(irate(hono_messages_received_seconds_count{type=\"telemetry\",status=\"forwarded\"}[$__rate_interval]))",
"format": "time_series",
"instant": false,
"intervalFactor": 1,
Expand Down Expand Up @@ -263,21 +263,21 @@
"steppedLine": false,
"targets": [
{
"expr": "sum(irate(hono_messages_received_seconds_count{type=\"event\",status=\"unprocessable\"}[$__range]))",
"expr": "sum(irate(hono_messages_received_seconds_count{type=\"event\",status=\"unprocessable\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "unprocessable",
"refId": "C"
},
{
"expr": "sum(irate(hono_messages_received_seconds_count{type=\"event\",status=\"undeliverable\"}[$__range]))",
"expr": "sum(irate(hono_messages_received_seconds_count{type=\"event\",status=\"undeliverable\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "undeliverable",
"refId": "B"
},
{
"expr": "sum(irate(hono_messages_received_seconds_count{type=\"event\",status=\"forwarded\"}[$__range]))",
"expr": "sum(irate(hono_messages_received_seconds_count{type=\"event\",status=\"forwarded\"}[$__rate_interval]))",
"format": "time_series",
"instant": false,
"intervalFactor": 1,
Expand Down Expand Up @@ -367,15 +367,15 @@
"steppedLine": false,
"targets": [
{
"expr": "sum(irate(hono_commands_received_seconds_count{direction=~\"one-way|request\",status=\"unprocessable\"}[$__range]))",
"expr": "sum(irate(hono_commands_received_seconds_count{direction=~\"one-way|request\",status=\"unprocessable\"}[$__rate_interval]))",
"format": "time_series",
"interval": "",
"intervalFactor": 1,
"legendFormat": "unprocessable",
"refId": "C"
},
{
"expr": "sum(irate(hono_commands_received_seconds_count{direction=~\"one-way|request\",status=\"undeliverable\"}[$__range]))",
"expr": "sum(irate(hono_commands_received_seconds_count{direction=~\"one-way|request\",status=\"undeliverable\"}[$__rate_interval]))",
"format": "time_series",
"hide": false,
"interval": "",
Expand All @@ -384,7 +384,7 @@
"refId": "B"
},
{
"expr": "sum(irate(hono_commands_received_seconds_count{direction=~\"one-way|request\",status=\"forwarded\"}[$__range]))",
"expr": "sum(irate(hono_commands_received_seconds_count{direction=~\"one-way|request\",status=\"forwarded\"}[$__rate_interval]))",
"format": "time_series",
"instant": false,
"intervalFactor": 1,
Expand Down Expand Up @@ -473,21 +473,21 @@
"steppedLine": false,
"targets": [
{
"expr": "sum(irate(hono_messages_payload_bytes_sum{type=\"telemetry\",status=\"unprocessable\"}[$__range]))",
"expr": "sum(irate(hono_messages_payload_bytes_sum{type=\"telemetry\",status=\"unprocessable\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "unprocessable",
"refId": "C"
},
{
"expr": "sum(irate(hono_messages_payload_bytes_sum{type=\"telemetry\",status=\"undeliverable\"}[$__range]))",
"expr": "sum(irate(hono_messages_payload_bytes_sum{type=\"telemetry\",status=\"undeliverable\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "undeliverable",
"refId": "B"
},
{
"expr": "sum(irate(hono_messages_payload_bytes_sum{type=\"telemetry\",status=\"forwarded\"}[$__range]))",
"expr": "sum(irate(hono_messages_payload_bytes_sum{type=\"telemetry\",status=\"forwarded\"}[$__rate_interval]))",
"format": "time_series",
"instant": false,
"intervalFactor": 1,
Expand Down Expand Up @@ -575,21 +575,21 @@
"steppedLine": false,
"targets": [
{
"expr": "sum(irate(hono_messages_payload_bytes_sum{type=\"event\",status=\"unprocessable\"}[$__range]))",
"expr": "sum(irate(hono_messages_payload_bytes_sum{type=\"event\",status=\"unprocessable\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "unprocessable",
"refId": "C"
},
{
"expr": "sum(irate(hono_messages_payload_bytes_sum{type=\"event\",status=\"undeliverable\"}[$__range]))",
"expr": "sum(irate(hono_messages_payload_bytes_sum{type=\"event\",status=\"undeliverable\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "undeliverable",
"refId": "B"
},
{
"expr": "sum(irate(hono_messages_payload_bytes_sum{type=\"event\",status=\"forwarded\"}[$__range]))",
"expr": "sum(irate(hono_messages_payload_bytes_sum{type=\"event\",status=\"forwarded\"}[$__rate_interval]))",
"format": "time_series",
"instant": false,
"intervalFactor": 1,
Expand Down Expand Up @@ -679,21 +679,21 @@
"steppedLine": false,
"targets": [
{
"expr": "sum(irate(hono_commands_payload_bytes_sum{direction=~\"one-way|request\",status=\"unprocessable\"}[$__range]))",
"expr": "sum(irate(hono_commands_payload_bytes_sum{direction=~\"one-way|request\",status=\"unprocessable\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "unprocessable",
"refId": "C"
},
{
"expr": "sum(irate(hono_commands_payload_bytes_sum{direction=~\"one-way|request\",status=\"undeliverable\"}[$__range]))",
"expr": "sum(irate(hono_commands_payload_bytes_sum{direction=~\"one-way|request\",status=\"undeliverable\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "undeliverable",
"refId": "B"
},
{
"expr": "sum(irate(hono_commands_payload_bytes_sum{direction=~\"one-way|request\",status=\"forwarded\"}[$__range]))",
"expr": "sum(irate(hono_commands_payload_bytes_sum{direction=~\"one-way|request\",status=\"forwarded\"}[$__rate_interval]))",
"format": "time_series",
"instant": false,
"intervalFactor": 1,
Expand Down Expand Up @@ -781,14 +781,14 @@
"steppedLine": false,
"targets": [
{
"expr": "(100 * sum(irate(hono_messages_received_seconds_count{type=\"telemetry\",qos=\"0\",status=\"undeliverable\"}[$__range])))\n/\nsum(irate(hono_messages_received_seconds_count{type=\"telemetry\",qos=\"0\"}[$__range]))",
"expr": "(100 * sum(irate(hono_messages_received_seconds_count{type=\"telemetry\",qos=\"0\",status=\"undeliverable\"}[$__rate_interval])))\n/\nsum(irate(hono_messages_received_seconds_count{type=\"telemetry\",qos=\"0\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "QoS 0",
"refId": "C"
},
{
"expr": "(100 * sum(irate(hono_messages_received_seconds_count{type=\"telemetry\",qos=\"1\",status=\"undeliverable\"}[$__range])))\n/\nsum(irate(hono_messages_received_seconds_count{type=\"telemetry\",qos=\"1\"}[$__range]))",
"expr": "(100 * sum(irate(hono_messages_received_seconds_count{type=\"telemetry\",qos=\"1\",status=\"undeliverable\"}[$__rate_interval])))\n/\nsum(irate(hono_messages_received_seconds_count{type=\"telemetry\",qos=\"1\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "QoS 1",
Expand Down Expand Up @@ -892,7 +892,7 @@
"steppedLine": false,
"targets": [
{
"expr": "(100 * sum(irate(hono_messages_received_seconds_count{type=\"event\",status=\"undeliverable\"}[$__range])))\n/\nsum(irate(hono_messages_received_seconds_count{type=\"event\"}[$__range]))",
"expr": "(100 * sum(irate(hono_messages_received_seconds_count{type=\"event\",status=\"undeliverable\"}[$__rate_interval])))\n/\nsum(irate(hono_messages_received_seconds_count{type=\"event\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "not forwarded",
Expand Down Expand Up @@ -996,7 +996,7 @@
"steppedLine": false,
"targets": [
{
"expr": "(100 * sum(irate(hono_commands_received_seconds_count{direction=~\"one-way|request\",status=\"undeliverable\"}[$__range])))\n/\nsum(irate(hono_commands_received_seconds_count{direction=~\"one-way|request\"}[$__range]))",
"expr": "(100 * sum(irate(hono_commands_received_seconds_count{direction=~\"one-way|request\",status=\"undeliverable\"}[$__rate_interval])))\n/\nsum(irate(hono_commands_received_seconds_count{direction=~\"one-way|request\"}[$__rate_interval]))",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "not forwarded",
Expand Down

0 comments on commit 721c077

Please sign in to comment.