diff --git a/pkg/loki/modules.go b/pkg/loki/modules.go index 05730bc9d6e9..19b72c774f6f 100644 --- a/pkg/loki/modules.go +++ b/pkg/loki/modules.go @@ -293,13 +293,21 @@ func (t *Loki) initQueryFrontend() (err error) { } t.stopper = stopper t.frontend.Wrap(tripperware) - frontend.RegisterFrontendServer(t.server.GRPC, t.frontend) - t.server.HTTP.PathPrefix(t.cfg.HTTPPrefix).Handler( - t.httpAuthMiddleware.Wrap( - t.frontend.Handler(), - ), - ) + + frontendHandler := t.httpAuthMiddleware.Wrap(t.frontend.Handler()) + t.server.HTTP.Handle("/loki/api/v1/query_range", frontendHandler) + t.server.HTTP.Handle("/loki/api/v1/query", frontendHandler) + t.server.HTTP.Handle("/loki/api/v1/label", frontendHandler) + t.server.HTTP.Handle("/loki/api/v1/labels", frontendHandler) + t.server.HTTP.Handle("/loki/api/v1/label/{name}/values", frontendHandler) + t.server.HTTP.Handle("/loki/api/v1/series", frontendHandler) + t.server.HTTP.Handle("/api/prom/query", frontendHandler) + t.server.HTTP.Handle("/api/prom/label", frontendHandler) + t.server.HTTP.Handle("/api/prom/label/{name}/values", frontendHandler) + t.server.HTTP.Handle("/api/prom/series", frontendHandler) + // fallback route + t.server.HTTP.PathPrefix("/").Handler(frontendHandler) return } diff --git a/production/loki-mixin/dashboards.libsonnet b/production/loki-mixin/dashboards.libsonnet index acaacd1d0539..a9ac85c8e7f1 100644 --- a/production/loki-mixin/dashboards.libsonnet +++ b/production/loki-mixin/dashboards.libsonnet @@ -56,6 +56,17 @@ local utils = import 'mixin-utils/utils.libsonnet'; utils.latencyRecordingRulePanel('loki_request_duration_seconds', [utils.selector.eq('job', '$namespace/cortex-gw'), utils.selector.re('route', 'api_prom_query|api_prom_labels|api_prom_label_name_values|loki_api_v1_query|loki_api_v1_query_range|loki_api_v1_label|loki_api_v1_label_name_values')], extra_selectors=[utils.selector.eq('cluster', '$cluster')], sum_by=['route']) ) ) + .addRow( + g.row('Frontend (query-frontend)') + .addPanel( + g.panel('QPS') + + g.qpsPanel('loki_request_duration_seconds_count{cluster="$cluster", job="$namespace/query-frontend", route=~"api_prom_query|api_prom_label|api_prom_label_name_values|loki_api_v1_query|loki_api_v1_query_range|loki_api_v1_label|loki_api_v1_label_name_values"}') + ) + .addPanel( + g.panel('Latency') + + utils.latencyRecordingRulePanel('loki_request_duration_seconds', [utils.selector.eq('job', '$namespace/query-frontend'), utils.selector.re('route', 'api_prom_query|api_prom_labels|api_prom_label_name_values|loki_api_v1_query|loki_api_v1_query_range|loki_api_v1_label|loki_api_v1_label_name_values')], extra_selectors=[utils.selector.eq('cluster', '$cluster')], sum_by=['route']) + ) + ) .addRow( g.row('Querier') .addPanel(