diff --git a/CHANGELOG.md b/CHANGELOG.md index 191d3a8e7e..a0556f5078 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/examples/dashboards/dashboards.md b/examples/dashboards/dashboards.md index 766ffcf2df..4cff60678d 100644 --- a/examples/dashboards/dashboards.md +++ b/examples/dashboards/dashboards.md @@ -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) diff --git a/examples/dashboards/query_frontend.json b/examples/dashboards/queryFrontend.json similarity index 99% rename from examples/dashboards/query_frontend.json rename to examples/dashboards/queryFrontend.json index 644555b4f8..07b4b33346 100644 --- a/examples/dashboards/query_frontend.json +++ b/examples/dashboards/queryFrontend.json @@ -1112,6 +1112,6 @@ }, "timezone": "UTC", "title": "Thanos / Query Frontend", - "uid": "303c4e660a475c4c8cf6aee97da3a24a", + "uid": "9bc9f8bb21d4d18193c3fe772b36c306", "version": 0 } diff --git a/mixin/README.md b/mixin/README.md index 03758eb256..1ecedabb95 100644 --- a/mixin/README.md +++ b/mixin/README.md @@ -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, }, diff --git a/mixin/config.libsonnet b/mixin/config.libsonnet index 962c351356..55e4e9cb17 100644 --- a/mixin/config.libsonnet +++ b/mixin/config.libsonnet @@ -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, }, diff --git a/mixin/dashboards/query_frontend.libsonnet b/mixin/dashboards/query_frontend.libsonnet index 3c3728cb83..136f7405f4 100644 --- a/mixin/dashboards/query_frontend.libsonnet +++ b/mixin/dashboards/query_frontend.libsonnet @@ -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:: { @@ -12,28 +12,28 @@ 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( @@ -41,7 +41,7 @@ local utils = import '../lib/utils.libsonnet'; .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 @@ -49,11 +49,11 @@ local utils = import '../lib/utils.libsonnet'; .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 @@ -61,7 +61,7 @@ local utils = import '../lib/utils.libsonnet'; .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 @@ -69,14 +69,14 @@ local utils = import '../lib/utils.libsonnet'; .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) ), }, }