Skip to content

Commit

Permalink
Change to queryFrontend instead of query_frontend
Browse files Browse the repository at this point in the history
Signed-off-by: Jéssica Lins <jlins@redhat.com>
  • Loading branch information
Jéssica Lins committed Nov 12, 2021
1 parent 429eb66 commit ff226e2
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 21 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re
- [#4576](https://github.com/thanos-io/thanos/pull/4576) UI: add filter compaction level to the Block UI.
- [#4731](https://github.com/thanos-io/thanos/pull/4731) Rule: add stateless mode to ruler according to https://thanos.io/tip/proposals-accepted/202005-scalable-rule-storage.md/. Continue https://github.com/thanos-io/thanos/pull/4250.
- [#4612](https://github.com/thanos-io/thanos/pull/4612) Sidecar: add `--prometheus.http-client` and `--prometheus.http-client-file` flag for sidecar to connect Prometheus with basic auth or TLS.
- [#4848](https://github.com/thanos-io/thanos/pull/4848) Compactor: added Prometheus metric for tracking the progress of retention.
- [#4856](https://github.com/thanos-io/thanos/pull/4856) Mixin: Add Query Frontend Grafana dashboard.

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion examples/dashboards/dashboards.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ There exists Grafana dashboards for each component (not all of them complete) ta
- [Thanos Overview](overview.json)
- [Thanos Compact](compact.json)
- [Thanos Querier](query.json)
- [Thanos Query Frontend](query_frontend.json)
- [Thanos Query Frontend](queryFrontend.json)
- [Thanos Store](store.json)
- [Thanos Receiver](receive.json)
- [Thanos Sidecar](sidecar.json)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1112,6 +1112,6 @@
},
"timezone": "UTC",
"title": "Thanos / Query Frontend",
"uid": "303c4e660a475c4c8cf6aee97da3a24a",
"uid": "9bc9f8bb21d4d18193c3fe772b36c306",
"version": 0
}
2 changes: 1 addition & 1 deletion mixin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ This project is intended to be used as a library. You can extend and customize d
selector: 'job=~".*thanos-query.*"',
title: '%(prefix)sQuery' % $.dashboard.prefix,
},
query_frontend+:: {
queryFrontend+:: {
selector: 'job=~".*thanos-query-frontend.*"',
title: '%(prefix)sQuery Frontend' % $.dashboard.prefix,
},
Expand Down
2 changes: 1 addition & 1 deletion mixin/config.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
selector: 'job=~".*thanos-query.*"',
title: '%(prefix)sQuery' % $.dashboard.prefix,
},
query_frontend+:: {
queryFrontend+:: {
selector: 'job=~".*thanos-query-frontend.*"',
title: '%(prefix)sQuery Frontend' % $.dashboard.prefix,
},
Expand Down
32 changes: 16 additions & 16 deletions mixin/dashboards/query_frontend.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ local utils = import '../lib/utils.libsonnet';

{
local thanos = self,
query_frontend+:: {
queryFrontend+:: {
selector: error 'must provide selector for Thanos Query Frontend dashboard',
title: error 'must provide title for Thanos Query Frontend dashboard',
dashboard:: {
Expand All @@ -12,71 +12,71 @@ local utils = import '../lib/utils.libsonnet';
},
},
grafanaDashboards+:: {
[if thanos.query_frontend != null then 'query_frontend.json']:
local queryFrontendHandlerSelector = utils.joinLabels([thanos.query_frontend.dashboard.selector, 'handler="query-frontend"']);
local queryFrontendTripperwareSelector = utils.joinLabels([thanos.query_frontend.dashboard.selector, 'tripperware="query_range"']);
local queryFrontendOpSelector = utils.joinLabels([thanos.query_frontend.dashboard.selector, 'op="query_range"']);
g.dashboard(thanos.query_frontend.title)
[if thanos.queryFrontend != null then 'queryFrontend.json']:
local queryFrontendHandlerSelector = utils.joinLabels([thanos.queryFrontend.dashboard.selector, 'handler="query-frontend"']);
local queryFrontendTripperwareSelector = utils.joinLabels([thanos.queryFrontend.dashboard.selector, 'tripperware="query_range"']);
local queryFrontendOpSelector = utils.joinLabels([thanos.queryFrontend.dashboard.selector, 'op="query_range"']);
g.dashboard(thanos.queryFrontend.title)
.addRow(
g.row('Query Frontend API')
.addPanel(
g.panel('Rate of requests', 'Shows rate of requests against Query Frontend for the given time.') +
g.httpQpsPanel('http_requests_total', queryFrontendHandlerSelector, thanos.query_frontend.dashboard.dimensions)
g.httpQpsPanel('http_requests_total', queryFrontendHandlerSelector, thanos.queryFrontend.dashboard.dimensions)
)
.addPanel(
g.panel('Rate of queries', 'Shows rate of queries passing through Query Frontend') +
g.httpQpsPanel('thanos_query_frontend_queries_total', queryFrontendOpSelector, thanos.query_frontend.dashboard.dimensions)
g.httpQpsPanel('thanos_query_frontend_queries_total', queryFrontendOpSelector, thanos.queryFrontend.dashboard.dimensions)
)
.addPanel(
g.panel('Errors', 'Shows ratio of errors compared to the the total number of handled requests against Query Frontend.') +
g.httpErrPanel('http_requests_total', queryFrontendHandlerSelector, thanos.query_frontend.dashboard.dimensions)
g.httpErrPanel('http_requests_total', queryFrontendHandlerSelector, thanos.queryFrontend.dashboard.dimensions)
)
.addPanel(
g.panel('Duration', 'Shows how long has it taken to handle requests in quantiles.') +
g.latencyPanel('http_request_duration_seconds', queryFrontendHandlerSelector, thanos.query_frontend.dashboard.dimensions)
g.latencyPanel('http_request_duration_seconds', queryFrontendHandlerSelector, thanos.queryFrontend.dashboard.dimensions)
)
)
.addRow(
g.row('Cache Operations')
.addPanel(
g.panel('Requests', 'Show rate of cache requests.') +
g.queryPanel(
'sum by (%s) (rate(cortex_cache_request_duration_seconds_count{%s}[$interval]))' % [utils.joinLabels([thanos.query_frontend.dashboard.dimensions, 'tripperware']), thanos.query_frontend.dashboard.selector],
'sum by (%s) (rate(cortex_cache_request_duration_seconds_count{%s}[$interval]))' % [utils.joinLabels([thanos.queryFrontend.dashboard.dimensions, 'tripperware']), thanos.queryFrontend.dashboard.selector],
'{{job}} {{tripperware}}',
) +
g.stack
)
.addPanel(
g.panel('Querier cache gets vs misses', 'Show rate of Querier cache gets vs misses.') +
g.queryPanel(
'sum by (%s) (rate(querier_cache_gets_total{%s}[$interval]))' % [utils.joinLabels([thanos.query_frontend.dashboard.dimensions, 'tripperware']), thanos.query_frontend.dashboard.selector],
'sum by (%s) (rate(querier_cache_gets_total{%s}[$interval]))' % [utils.joinLabels([thanos.queryFrontend.dashboard.dimensions, 'tripperware']), thanos.queryFrontend.dashboard.selector],
'Cache gets - {{job}} {{tripperware}}',
) +
g.queryPanel(
'sum by (%s) (rate(querier_cache_misses_total{%s}[$interval]))' % [utils.joinLabels([thanos.query_frontend.dashboard.dimensions, 'tripperware']), thanos.query_frontend.dashboard.selector],
'sum by (%s) (rate(querier_cache_misses_total{%s}[$interval]))' % [utils.joinLabels([thanos.queryFrontend.dashboard.dimensions, 'tripperware']), thanos.queryFrontend.dashboard.selector],
'Cache misses - {{job}} {{tripperware}}',
) +
g.stack
)
.addPanel(
g.panel('Cortex fetched keys', 'Shows rate of cortex fetched keys.') +
g.queryPanel(
'sum by (%s) (rate(cortex_cache_fetched_keys{%s}[$interval]))' % [utils.joinLabels([thanos.query_frontend.dashboard.dimensions, 'tripperware']), thanos.query_frontend.dashboard.selector],
'sum by (%s) (rate(cortex_cache_fetched_keys{%s}[$interval]))' % [utils.joinLabels([thanos.queryFrontend.dashboard.dimensions, 'tripperware']), thanos.queryFrontend.dashboard.selector],
'{{job}} {{tripperware}}',
) +
g.stack
)
.addPanel(
g.panel('Cortex cache hits', 'Shows rate of cortex cache hits.') +
g.queryPanel(
'sum by (%s) (rate(cortex_cache_hits{%s}[$interval]))' % [utils.joinLabels([thanos.query_frontend.dashboard.dimensions, 'tripperware']), thanos.query_frontend.dashboard.selector],
'sum by (%s) (rate(cortex_cache_hits{%s}[$interval]))' % [utils.joinLabels([thanos.queryFrontend.dashboard.dimensions, 'tripperware']), thanos.queryFrontend.dashboard.selector],
'{{job}} {{tripperware}}',
) +
g.stack
)
)
.addRow(
g.resourceUtilizationRow(thanos.query_frontend.dashboard.selector, thanos.query_frontend.dashboard.dimensions)
g.resourceUtilizationRow(thanos.queryFrontend.dashboard.selector, thanos.queryFrontend.dashboard.dimensions)
),
},
}

0 comments on commit ff226e2

Please sign in to comment.