Skip to content

Commit

Permalink
Add time unit in so11y latency metrics (#12719)
Browse files Browse the repository at this point in the history
  • Loading branch information
kezhenxu94 authored Oct 23, 2024
1 parent 80d3e29 commit 38b775e
Show file tree
Hide file tree
Showing 35 changed files with 199 additions and 119 deletions.
25 changes: 25 additions & 0 deletions docs/en/changes/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,31 @@
* Add Component ID(5023) for the GoZero framework.
* Support Kong monitoring.
* Support adding additional attr[0-4] for service level metrics.
* All self observability histogram metrics names are suffixed with `_seconds` to indicate the time unit, as per [Prometheus metrics names guide](https://prometheus.io/docs/practices/naming/),
if you have any customized configuration files that utilize these metrics, you can migrate the metrics names with our helper script `tools/migrate-so11y-metrics-names.sh`,
this script migrates the metrics names in files `*.yaml`, `*.java`, and `*.json` files, review and adjust the script if you have other file types.
NOTE: the script doesn't migrate existing metrics data.
* `browser_error_log_in_latency` -> `browser_error_log_in_latency_seconds`
* `browser_perf_data_in_latency` -> `browser_perf_data_in_latency_seconds`
* `envoy_als_in_latency` -> `envoy_als_in_latency_seconds`
* `envoy_metric_in_latency` -> `envoy_metric_in_latency_seconds`
* `event_in_latency` -> `event_in_latency_seconds`
* `graphql_query_latency` -> `graphql_query_latency_seconds`
* `k8s_als_in_latency` -> `k8s_als_in_latency_seconds`
* `log_in_latency` -> `log_in_latency_seconds`
* `mesh_analysis_latency` -> `mesh_analysis_latency_seconds`
* `meter_batch_in_latency` -> `meter_batch_in_latency_seconds`
* `meter_in_latency` -> `meter_in_latency_seconds`
* `otel_logs_latency` -> `otel_logs_latency_seconds`
* `otel_metrics_latency` -> `otel_metrics_latency_seconds`
* `otel_spans_latency` -> `otel_spans_latency_seconds`
* `persistence_timer_bulk_all_latency` -> `persistence_timer_bulk_all_latency_seconds`
* `persistence_timer_bulk_execute_latency` -> `persistence_timer_bulk_execute_latency_seconds`
* `persistence_timer_bulk_prepare_latency` -> `persistence_timer_bulk_prepare_latency_seconds`
* `profile_task_in_latency` -> `profile_task_in_latency_seconds`
* `remote_in_latency` -> `remote_in_latency_seconds`
* `telegraf_in_latency` -> `telegraf_in_latency_seconds`
* `trace_in_latency` -> `trace_in_latency_seconds`

#### UI

Expand Down
64 changes: 32 additions & 32 deletions docs/en/setup/backend/grafana-cluster.json
Original file line number Diff line number Diff line change
Expand Up @@ -1177,12 +1177,12 @@
"steppedLine": false,
"targets": [
{
"expr": "sum(rate(trace_in_latency_count{job=\"$job\"}[1m]))",
"expr": "sum(rate(trace_in_latency_seconds_count{job=\"$job\"}[1m]))",
"legendFormat": "total",
"refId": "B"
},
{
"expr": "rate(trace_in_latency_count{job=\"$job\"}[1m])",
"expr": "rate(trace_in_latency_seconds_count{job=\"$job\"}[1m])",
"legendFormat": "{{instance}}-{{protocol}}",
"refId": "A"
}
Expand Down Expand Up @@ -1271,7 +1271,7 @@
"steppedLine": false,
"targets": [
{
"expr": "increase(trace_in_latency_sum{job=\"$job\"}[1m])",
"expr": "increase(trace_in_latency_seconds_sum{job=\"$job\"}[1m])",
"format": "time_series",
"hide": false,
"instant": false,
Expand Down Expand Up @@ -1454,12 +1454,12 @@
"steppedLine": false,
"targets": [
{
"expr": "sum(rate(mesh_analysis_latency_count{job=\"$job\"}[1m]))",
"expr": "sum(rate(mesh_analysis_latency_seconds_count{job=\"$job\"}[1m]))",
"legendFormat": "total",
"refId": "A"
},
{
"expr": "rate(mesh_analysis_latency_count{job=\"$job\"}[1m])",
"expr": "rate(mesh_analysis_latency_seconds_count{job=\"$job\"}[1m])",
"legendFormat": "{{instance}}",
"refId": "B"
}
Expand Down Expand Up @@ -1548,7 +1548,7 @@
"steppedLine": false,
"targets": [
{
"expr": "increase(mesh_analysis_latency_sum{job=\"$job\"}[1m])",
"expr": "increase(mesh_analysis_latency_seconds_sum{job=\"$job\"}[1m])",
"format": "time_series",
"hide": false,
"instant": false,
Expand Down Expand Up @@ -1829,7 +1829,7 @@
"steppedLine": false,
"targets": [
{
"expr": "increase(k8s_als_in_latency_sum{job=\"$job\"}[1m])",
"expr": "increase(k8s_als_in_latency_seconds_sum{job=\"$job\"}[1m])",
"interval": "",
"legendFormat": "{{instance}}",
"refId": "A"
Expand Down Expand Up @@ -2006,12 +2006,12 @@
"steppedLine": false,
"targets": [
{
"expr": "sum(rate(meter_in_latency_count{job=\"$job\"}[1m]))",
"expr": "sum(rate(meter_in_latency_seconds_count{job=\"$job\"}[1m]))",
"legendFormat": "total",
"refId": "A"
},
{
"expr": "rate(meter_in_latency_count{job=\"$job\"}[1m])",
"expr": "rate(meter_in_latency_seconds_count{job=\"$job\"}[1m])",
"legendFormat": "{{instance}}-{{protocol}}",
"refId": "B"
}
Expand Down Expand Up @@ -2100,7 +2100,7 @@
"steppedLine": false,
"targets": [
{
"expr": "increase(meter_in_latency_sum{job=\"$job\"}[1m])",
"expr": "increase(meter_in_latency_seconds_sum{job=\"$job\"}[1m])",
"format": "time_series",
"hide": false,
"instant": false,
Expand Down Expand Up @@ -2287,12 +2287,12 @@
"steppedLine": false,
"targets": [
{
"expr": "sum(rate(log_in_latency_count{job=\"$job\"}[1m]))",
"expr": "sum(rate(log_in_latency_seconds_count{job=\"$job\"}[1m]))",
"legendFormat": "total",
"refId": "A"
},
{
"expr": "rate(log_in_latency_count{job=\"$job\"}[1m])",
"expr": "rate(log_in_latency_seconds_count{job=\"$job\"}[1m])",
"legendFormat": "{{instance}}-{{protocol}}",
"refId": "B"
}
Expand Down Expand Up @@ -2381,7 +2381,7 @@
"steppedLine": false,
"targets": [
{
"expr": "increase(log_in_latency_sum{job=\"$job\"}[1m])",
"expr": "increase(log_in_latency_seconds_sum{job=\"$job\"}[1m])",
"format": "time_series",
"hide": false,
"instant": false,
Expand Down Expand Up @@ -2568,12 +2568,12 @@
"steppedLine": false,
"targets": [
{
"expr": "sum(rate(event_in_latency_count{job=\"$job\"}[1m]))",
"expr": "sum(rate(event_in_latency_seconds_count{job=\"$job\"}[1m]))",
"legendFormat": "total",
"refId": "A"
},
{
"expr": "rate(event_in_latency_count{job=\"$job\"}[1m])",
"expr": "rate(event_in_latency_seconds_count{job=\"$job\"}[1m])",
"legendFormat": "{{instance}}-{{protocol}}",
"refId": "B"
}
Expand Down Expand Up @@ -2662,7 +2662,7 @@
"steppedLine": false,
"targets": [
{
"expr": "increase(event_in_latency_sum{job=\"$job\"}[1m])",
"expr": "increase(event_in_latency_seconds_sum{job=\"$job\"}[1m])",
"format": "time_series",
"hide": false,
"instant": false,
Expand Down Expand Up @@ -2849,12 +2849,12 @@
"steppedLine": false,
"targets": [
{
"expr": "sum(rate(browser_perf_data_in_latency_count{job=\"$job\"}[1m]))",
"expr": "sum(rate(browser_perf_data_in_latency_seconds_count{job=\"$job\"}[1m]))",
"legendFormat": "total",
"refId": "A"
},
{
"expr": "rate(browser_perf_data_in_latency_count{job=\"$job\"}[1m])",
"expr": "rate(browser_perf_data_in_latency_seconds_count{job=\"$job\"}[1m])",
"legendFormat": "{{instance}}-{{protocol}}",
"refId": "B"
}
Expand Down Expand Up @@ -2943,7 +2943,7 @@
"steppedLine": false,
"targets": [
{
"expr": "increase(browser_perf_data_in_latency_sum{job=\"$job\"}[1m])",
"expr": "increase(browser_perf_data_in_latency_seconds_sum{job=\"$job\"}[1m])",
"format": "time_series",
"hide": false,
"instant": false,
Expand Down Expand Up @@ -3130,12 +3130,12 @@
"steppedLine": false,
"targets": [
{
"expr": "sum(rate(browser_error_log_in_latency_count{job=\"$job\"}[1m]))",
"expr": "sum(rate(browser_error_log_in_latency_seconds_seconds_count{job=\"$job\"}[1m]))",
"legendFormat": "total",
"refId": "A"
},
{
"expr": "rate(browser_error_log_in_latency_count{job=\"$job\"}[1m])",
"expr": "rate(browser_error_log_in_latency_seconds_seconds_count{job=\"$job\"}[1m])",
"legendFormat": "{{instance}}-{{protocol}}",
"refId": "B"
}
Expand Down Expand Up @@ -3224,7 +3224,7 @@
"steppedLine": false,
"targets": [
{
"expr": "increase(browser_error_log_in_latency_sum{job=\"$job\"}[1m])",
"expr": "increase(browser_error_log_in_latency_seconds_seconds_sum{job=\"$job\"}[1m])",
"format": "time_series",
"hide": false,
"instant": false,
Expand Down Expand Up @@ -3692,13 +3692,13 @@
"steppedLine": false,
"targets": [
{
"expr": "sum(increase(trace_in_latency_count{job=\"$job\",protocol=~\"kafka-fetcher|grpc\"}[1h]))",
"expr": "sum(increase(trace_in_latency_seconds_count{job=\"$job\",protocol=~\"kafka-fetcher|grpc\"}[1h]))",
"interval": "1h",
"legendFormat": "Current Week",
"refId": "B"
},
{
"expr": "sum(increase(trace_in_latency_count{job=\"$job\",protocol=~\"kafka-fetcher|grpc\"}[1h] offset 1w))",
"expr": "sum(increase(trace_in_latency_seconds_count{job=\"$job\",protocol=~\"kafka-fetcher|grpc\"}[1h] offset 1w))",
"interval": "1h",
"legendFormat": "Last Week",
"refId": "A"
Expand Down Expand Up @@ -3787,13 +3787,13 @@
"steppedLine": false,
"targets": [
{
"expr": "sum(increase(trace_in_latency_count{job=\"$job\",protocol=~\"kafka-fetcher|grpc\"}[1d]))",
"expr": "sum(increase(trace_in_latency_seconds_count{job=\"$job\",protocol=~\"kafka-fetcher|grpc\"}[1d]))",
"interval": "1d",
"legendFormat": "Current Week",
"refId": "B"
},
{
"expr": "sum(increase(trace_in_latency_count{job=\"$job\",protocol=~\"kafka-fetcher|grpc\"}[1d] offset 1w))",
"expr": "sum(increase(trace_in_latency_seconds_count{job=\"$job\",protocol=~\"kafka-fetcher|grpc\"}[1d] offset 1w))",
"interval": "1d",
"legendFormat": "Last Week",
"refId": "A"
Expand Down Expand Up @@ -4066,12 +4066,12 @@
"steppedLine": false,
"targets": [
{
"expr": "sum(rate(remote_in_latency_count{job=\"$job\"}[1m]))",
"expr": "sum(rate(remote_in_latency_seconds_count{job=\"$job\"}[1m]))",
"legendFormat": "total",
"refId": "A"
},
{
"expr": "rate(remote_in_latency_count{job=\"$job\"}[1m])",
"expr": "rate(remote_in_latency_seconds_count{job=\"$job\"}[1m])",
"legendFormat": "{{instance}}",
"refId": "B"
}
Expand Down Expand Up @@ -4231,7 +4231,7 @@
"steppedLine": false,
"targets": [
{
"expr": "increase(persistence_timer_bulk_prepare_latency_count{job=\"$job\"}[1m])",
"expr": "increase(persistence_timer_bulk_prepare_latency_seconds_count{job=\"$job\"}[1m])",
"instant": false,
"interval": "1m",
"legendFormat": "{{instance}}",
Expand Down Expand Up @@ -4322,7 +4322,7 @@
"steppedLine": false,
"targets": [
{
"expr": "increase(persistence_timer_bulk_prepare_latency_sum{job=\"$job\"}[1m])",
"expr": "increase(persistence_timer_bulk_prepare_latency_seconds_sum{job=\"$job\"}[1m])",
"interval": "1m",
"legendFormat": "{{instance}}",
"refId": "A"
Expand Down Expand Up @@ -4412,7 +4412,7 @@
"steppedLine": false,
"targets": [
{
"expr": "increase(persistence_timer_bulk_execute_latency_count{job=\"$job\"}[1m])",
"expr": "increase(persistence_timer_bulk_execute_latency_seconds_count{job=\"$job\"}[1m])",
"interval": "1m",
"legendFormat": "{{instance}}",
"refId": "A"
Expand Down Expand Up @@ -4502,7 +4502,7 @@
"steppedLine": false,
"targets": [
{
"expr": "increase(persistence_timer_bulk_execute_latency_sum{job=\"$job\"}[1m])",
"expr": "increase(persistence_timer_bulk_execute_latency_seconds_sum{job=\"$job\"}[1m])",
"interval": "1m",
"legendFormat": "{{instance}}",
"refId": "A"
Expand Down
Loading

0 comments on commit 38b775e

Please sign in to comment.