Skip to content

Commit

Permalink
Merge pull request #30 from kakkoyun/new_metrics
Browse files Browse the repository at this point in the history
Remove deprecated metrics
  • Loading branch information
metalmatze committed Sep 3, 2019
2 parents d08aaf9 + 4e1bfa7 commit 13c5dd3
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 58 deletions.
6 changes: 3 additions & 3 deletions dashboards/overview.json
Original file line number Diff line number Diff line change
Expand Up @@ -1247,7 +1247,7 @@
"steppedLine": false,
"targets": [
{
"expr": "sum(label_replace(rate(thanos_http_requests_total{namespace=\"$namespace\",job=~\"thanos-receive.*\"}[$interval]),\"status_code\", \"${1}xx\", \"code\", \"([0-9])..\")) by (job, status_code)",
"expr": "sum(label_replace(rate(http_requests_total{handler=\"receive\",namespace=\"$namespace\",job=~\"thanos-receive.*\"}[$interval]),\"status_code\", \"${1}xx\", \"code\", \"([0-9])..\")) by (job, status_code)",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "{{job}} {{status_code}}",
Expand Down Expand Up @@ -1333,7 +1333,7 @@
"steppedLine": false,
"targets": [
{
"expr": "sum(rate(thanos_http_requests_total{namespace=\"$namespace\",job=~\"thanos-receive.*\",code!~\"2..\"}[$interval])) / sum(rate(thanos_http_requests_total{namespace=\"$namespace\",job=~\"thanos-receive.*\"}[$interval]))",
"expr": "sum(rate(http_requests_total{handler=\"receive\",namespace=\"$namespace\",job=~\"thanos-receive.*\",code!~\"2..\"}[$interval])) / sum(rate(http_requests_total{handler=\"receive\",namespace=\"$namespace\",job=~\"thanos-receive.*\"}[$interval]))",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "error",
Expand Down Expand Up @@ -1417,7 +1417,7 @@
"steppedLine": false,
"targets": [
{
"expr": "histogram_quantile(0.99, sum(rate(thanos_http_request_duration_seconds_bucket{namespace=\"$namespace\",job=~\"thanos-receive.*\"}[$interval])) by (job, le))",
"expr": "histogram_quantile(0.99, sum(rate(http_request_duration_seconds_bucket{handler=\"receive\",namespace=\"$namespace\",job=~\"thanos-receive.*\"}[$interval])) by (job, le))",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "{{job}} P99",
Expand Down
20 changes: 10 additions & 10 deletions dashboards/receive.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"steppedLine": false,
"targets": [
{
"expr": "sum(label_replace(rate(thanos_http_requests_total{namespace=\"$namespace\",job=~\"$job\"}[$interval]),\"status_code\", \"${1}xx\", \"code\", \"([0-9])..\")) by (job, status_code)",
"expr": "sum(label_replace(rate(http_requests_total{handler=\"receive\",namespace=\"$namespace\",job=~\"$job\"}[$interval]),\"status_code\", \"${1}xx\", \"code\", \"([0-9])..\")) by (job, status_code)",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "{{job}} {{status_code}}",
Expand Down Expand Up @@ -131,7 +131,7 @@
"steppedLine": false,
"targets": [
{
"expr": "sum(rate(thanos_http_requests_total{namespace=\"$namespace\",job=~\"$job\",code!~\"2..\"}[$interval])) / sum(rate(thanos_http_requests_total{namespace=\"$namespace\",job=~\"$job\"}[$interval]))",
"expr": "sum(rate(http_requests_total{handler=\"receive\",namespace=\"$namespace\",job=~\"$job\",code!~\"2..\"}[$interval])) / sum(rate(http_requests_total{handler=\"receive\",namespace=\"$namespace\",job=~\"$job\"}[$interval]))",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "error",
Expand Down Expand Up @@ -207,23 +207,23 @@
"steppedLine": false,
"targets": [
{
"expr": "histogram_quantile(0.99, sum(rate(thanos_http_request_duration_seconds_bucket{namespace=\"$namespace\",job=~\"$job\"}[$interval])) by (job, le)) * 1",
"expr": "histogram_quantile(0.99, sum(rate(http_request_duration_seconds_bucket{handler=\"receive\",namespace=\"$namespace\",job=~\"$job\"}[$interval])) by (job, le)) * 1",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "P99 {{job}}",
"refId": "A",
"step": 10
},
{
"expr": "sum(rate(thanos_http_request_duration_seconds_sum{namespace=\"$namespace\",job=~\"$job\"}[$interval])) by (job) * 1 / sum(rate(thanos_http_request_duration_seconds_count{namespace=\"$namespace\",job=~\"$job\"}[$interval])) by (job)",
"expr": "sum(rate(http_request_duration_seconds_sum{handler=\"receive\",namespace=\"$namespace\",job=~\"$job\"}[$interval])) by (job) * 1 / sum(rate(http_request_duration_seconds_count{handler=\"receive\",namespace=\"$namespace\",job=~\"$job\"}[$interval])) by (job)",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "mean {{job}}",
"refId": "B",
"step": 10
},
{
"expr": "histogram_quantile(0.50, sum(rate(thanos_http_request_duration_seconds_bucket{namespace=\"$namespace\",job=~\"$job\"}[$interval])) by (job, le)) * 1",
"expr": "histogram_quantile(0.50, sum(rate(http_request_duration_seconds_bucket{handler=\"receive\",namespace=\"$namespace\",job=~\"$job\"}[$interval])) by (job, le)) * 1",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "P50 {{job}}",
Expand Down Expand Up @@ -319,7 +319,7 @@
"steppedLine": false,
"targets": [
{
"expr": "sum(label_replace(rate(thanos_http_requests_total{namespace=\"$namespace\",job=~\"$job\"}[$interval]),\"status_code\", \"${1}xx\", \"code\", \"([0-9])..\")) by (job, handler, status_code)",
"expr": "sum(label_replace(rate(http_requests_total{handler=\"receive\",namespace=\"$namespace\",job=~\"$job\"}[$interval]),\"status_code\", \"${1}xx\", \"code\", \"([0-9])..\")) by (job, handler, status_code)",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "{{job}} {{handler}} {{status_code}}",
Expand Down Expand Up @@ -395,7 +395,7 @@
"steppedLine": false,
"targets": [
{
"expr": "sum(rate(thanos_http_requests_total{namespace=\"$namespace\",job=~\"$job\",code!~\"2..\"}[$interval])) by (job, handler, code)",
"expr": "sum(rate(http_requests_total{handler=\"receive\",namespace=\"$namespace\",job=~\"$job\",code!~\"2..\"}[$interval])) by (job, handler, code)",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "{{job}} {{handler}} {{code}}",
Expand Down Expand Up @@ -471,23 +471,23 @@
"steppedLine": false,
"targets": [
{
"expr": "histogram_quantile(0.99, sum(rate(thanos_http_request_duration_seconds_bucket{namespace=\"$namespace\",job=~\"$job\"}[$interval])) by (job, handler, le)) * 1",
"expr": "histogram_quantile(0.99, sum(rate(http_request_duration_seconds_bucket{handler=\"receive\",namespace=\"$namespace\",job=~\"$job\"}[$interval])) by (job, handler, le)) * 1",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "P99 {{job}} {{handler}}",
"refId": "A",
"step": 10
},
{
"expr": "sum(rate(thanos_http_request_duration_seconds_sum{namespace=\"$namespace\",job=~\"$job\"}[$interval])) by (job, handler) * 1 / sum(rate(thanos_http_request_duration_seconds_count{namespace=\"$namespace\",job=~\"$job\"}[$interval])) by (job, handler)",
"expr": "sum(rate(http_request_duration_seconds_sum{handler=\"receive\",namespace=\"$namespace\",job=~\"$job\"}[$interval])) by (job, handler) * 1 / sum(rate(http_request_duration_seconds_count{handler=\"receive\",namespace=\"$namespace\",job=~\"$job\"}[$interval])) by (job, handler)",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "mean {{job}} {{handler}}",
"refId": "B",
"step": 10
},
{
"expr": "histogram_quantile(0.50, sum(rate(thanos_http_request_duration_seconds_bucket{namespace=\"$namespace\",job=~\"$job\"}[$interval])) by (job, handler, le)) * 1",
"expr": "histogram_quantile(0.50, sum(rate(http_request_duration_seconds_bucket{handler=\"receive\",namespace=\"$namespace\",job=~\"$job\"}[$interval])) by (job, handler, le)) * 1",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "P50 {{job}} {{handler}}",
Expand Down
6 changes: 3 additions & 3 deletions jsonnet/thanos-mixin/alerts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ groups:
$value }} seconds for instant queries.
expr: |
histogram_quantile(0.99,
sum(thanos_query_api_instant_query_duration_seconds_bucket{job=~"thanos-querier.*"}) by (job, le)
sum(http_request_duration_seconds_bucket{job=~"thanos-querier.*", handler="query"}) by (job, le)
) > 10
for: 10m
labels:
Expand All @@ -56,7 +56,7 @@ groups:
$value }} seconds for instant queries.
expr: |
histogram_quantile(0.99,
sum(thanos_query_api_range_query_duration_seconds_bucket{job=~"thanos-querier.*"}) by (job, le)
sum(http_request_duration_seconds_bucket{job=~"thanos-querier.*", handler="query_range"}) by (job, le)
) > 10
for: 10m
labels:
Expand All @@ -69,7 +69,7 @@ groups:
$value }} seconds for HTTP requests.
expr: |
histogram_quantile(0.99,
sum(thanos_http_request_duration_seconds_bucket{job=~"thanos-receive.*"}) by (job, le)
sum(http_request_duration_seconds_bucket{job=~"thanos-receive.*", handler="receive"}) by (job, le)
) > 10
for: 10m
labels:
Expand Down
4 changes: 2 additions & 2 deletions jsonnet/thanos-mixin/alerts/querier.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
},
expr: |||
histogram_quantile(0.99,
sum(thanos_query_api_instant_query_duration_seconds_bucket{%(thanosQuerierSelector)s}) by (job, le)
sum(http_request_duration_seconds_bucket{%(thanosQuerierSelector)s, handler="query"}) by (job, le)
) > 10
||| % $._config,
'for': '10m',
Expand All @@ -77,7 +77,7 @@
},
expr: |||
histogram_quantile(0.99,
sum(thanos_query_api_range_query_duration_seconds_bucket{%(thanosQuerierSelector)s}) by (job, le)
sum(http_request_duration_seconds_bucket{%(thanosQuerierSelector)s, handler="query_range"}) by (job, le)
) > 10
||| % $._config,
'for': '10m',
Expand Down
2 changes: 1 addition & 1 deletion jsonnet/thanos-mixin/alerts/receive.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
expr: |||
histogram_quantile(0.99,
sum(thanos_http_request_duration_seconds_bucket{%(thanosReceiveSelector)s}) by (job, le)
sum(http_request_duration_seconds_bucket{%(thanosReceiveSelector)s, handler="receive"}) by (job, le)
) > 10
||| % $._config,
'for': '10m',
Expand Down
18 changes: 9 additions & 9 deletions jsonnet/thanos-mixin/dashboards/receive.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,30 @@ local g = import '../lib/thanos-grafana-builder/builder.libsonnet';
g.row('Incoming Request')
.addPanel(
g.panel('Rate') +
g.httpQpsPanel('thanos_http_requests_total', 'namespace="$namespace",job=~"$job"')
g.httpQpsPanel('http_requests_total', 'handler="receive",namespace="$namespace",job=~"$job"')
)
.addPanel(
g.panel('Errors') +
g.httpErrPanel('thanos_http_requests_total', 'namespace="$namespace",job=~"$job"')
g.httpErrPanel('http_requests_total', 'handler="receive",namespace="$namespace",job=~"$job"')
)
.addPanel(
g.panel('Duration') +
g.latencyPanel('thanos_http_request_duration_seconds', 'namespace="$namespace",job=~"$job"')
g.latencyPanel('http_request_duration_seconds', 'handler="receive",namespace="$namespace",job=~"$job"')
)
)
.addRow(
g.row('Detailed')
.addPanel(
g.panel('Rate') +
g.httpQpsPanelDetailed('thanos_http_requests_total', 'namespace="$namespace",job=~"$job"')
g.httpQpsPanelDetailed('http_requests_total', 'handler="receive",namespace="$namespace",job=~"$job"')
)
.addPanel(
g.panel('Errors') +
g.httpErrDetailsPanel('thanos_http_requests_total', 'namespace="$namespace",job=~"$job"')
g.httpErrDetailsPanel('http_requests_total', 'handler="receive",namespace="$namespace",job=~"$job"')
)
.addPanel(
g.panel('Duration') +
g.httpLatencyDetailsPanel('thanos_http_request_duration_seconds', 'namespace="$namespace",job=~"$job"')
g.httpLatencyDetailsPanel('http_request_duration_seconds', 'handler="receive",namespace="$namespace",job=~"$job"')
) +
g.collapse
)
Expand Down Expand Up @@ -141,18 +141,18 @@ local g = import '../lib/thanos-grafana-builder/builder.libsonnet';
g.row('Receive')
.addPanel(
g.panel('Incoming Requests Rate') +
g.httpQpsPanel('thanos_http_requests_total', 'namespace="$namespace",%(thanosReceiveSelector)s' % $._config) +
g.httpQpsPanel('http_requests_total', 'handler="receive",namespace="$namespace",%(thanosReceiveSelector)s' % $._config) +
g.addDashboardLink($._config.grafanaThanos.dashboardReceiveTitle)
)
.addPanel(
g.panel('Incoming Requests Errors') +
g.httpErrPanel('thanos_http_requests_total', 'namespace="$namespace",%(thanosReceiveSelector)s' % $._config) +
g.httpErrPanel('http_requests_total', 'handler="receive",namespace="$namespace",%(thanosReceiveSelector)s' % $._config) +
g.addDashboardLink($._config.grafanaThanos.dashboardReceiveTitle)
)
.addPanel(
g.sloLatency(
'Incoming Requests Latency 99th Percentile',
'thanos_http_request_duration_seconds_bucket{namespace="$namespace",%(thanosReceiveSelector)s}' % $._config,
'http_request_duration_seconds_bucket{handler="receive",namespace="$namespace",%(thanosReceiveSelector)s}' % $._config,
0.99,
0.5,
1
Expand Down
30 changes: 15 additions & 15 deletions jsonnet/thanos-mixin/rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,32 +27,32 @@ groups:
record: :thanos_querier_store_apis_dns_failures_per_lookup:sum_rate
- expr: |
histogram_quantile(0.99,
sum(thanos_query_api_instant_query_duration_seconds_bucket{job=~"thanos-querier.*"}) by (le)
sum(http_request_duration_seconds_bucket{job=~"thanos-querier.*", handler="query"}) by (le)
)
labels:
quantile: "0.99"
record: :thanos_querier_api_instant_query_duration_seconds:p99:histogram_quantile
record: :query_duration_seconds:p99:histogram_quantile
- expr: |
histogram_quantile(0.99,
sum(rate(thanos_query_api_instant_query_duration_seconds_bucket{job=~"thanos-querier.*"}[5m])) by (le)
sum(rate(http_request_duration_seconds_bucket{job=~"thanos-querier.*", handler="query"}[5m])) by (le)
)
labels:
quantile: "0.99"
record: :thanos_querier_api_instant_query_duration_seconds:histogram_quantile
record: :query_duration_seconds:histogram_quantile
- expr: |
histogram_quantile(0.99,
sum(thanos_query_api_range_query_duration_seconds_bucket{job=~"thanos-querier.*"}) by (le)
sum(http_request_duration_seconds_bucket{job=~"thanos-querier.*", handler="query_range"}) by (le)
)
labels:
quantile: "0.99"
record: :thanos_querier_api_range_query_duration_seconds:histogram_quantile
record: :api_range_query_duration_seconds:histogram_quantile
- expr: |
histogram_quantile(0.99,
sum(rate(thanos_query_api_range_query_duration_seconds_bucket{job=~"thanos-querier.*"}[5m])) by (le)
sum(rate(http_request_duration_seconds_bucket{job=~"thanos-querier.*", handler="query_range"}[5m])) by (le)
)
labels:
quantile: "0.99"
record: :thanos_querier_api_range_query_duration_seconds:histogram_quantile
record: :api_range_query_duration_seconds:histogram_quantile
- name: thanos-receive.rules
rules:
- expr: |
Expand All @@ -73,26 +73,26 @@ groups:
record: :grpc_server_failures_per_stream:sum_rate
- expr: |
sum(
rate(thanos_http_requests_total{job=~"thanos-receive.*", code!~"2.."}[5m])
rate(http_requests_total{handler="receive", job=~"thanos-receive.*", code!~"2.."}[5m])
/
rate(thanos_http_requests_total{job=~"thanos-receive.*"}[5m])
rate(http_requests_total{handler="receive", job=~"thanos-receive.*"}[5m])
)
labels: {}
record: :thanos_http_failure_per_request:sum_rate
record: :http_failure_per_request:sum_rate
- expr: |
histogram_quantile(0.99,
sum(thanos_http_request_duration_seconds_bucket{job=~"thanos-receive.*"}) by (le)
sum(http_request_duration_seconds_bucket{handler="receive", job=~"thanos-receive.*"}) by (le)
)
labels:
quantile: "0.99"
record: :thanos_http_request_duration_seconds:histogram_quantile
record: :http_request_duration_seconds:histogram_quantile
- expr: |
histogram_quantile(0.99,
sum(rate(thanos_http_request_duration_seconds_bucket{job=~"thanos-receive.*"}[5m])) by (le)
sum(rate(http_request_duration_seconds_bucket{handler="receive", job=~"thanos-receive.*"}[5m])) by (le)
)
labels:
quantile: "0.99"
record: :thanos_http_request_duration_seconds:histogram_quantile
record: :http_request_duration_seconds:histogram_quantile
- expr: |
sum(
rate(thanos_receive_forward_requests_total{result="error", job=~"thanos-receive.*"}[5m])
Expand Down

0 comments on commit 13c5dd3

Please sign in to comment.