You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add basic query stats collection & logging.
Current collects & logs wall clock time and number of series in the queries.
TODO:
- collection number of samples
- propagate & aggregate in the query frontend
- add some metrics.
Signed-off-by: Tom Wilkie <[email protected]>
* Use time.Since()
Signed-off-by: Tom Wilkie <[email protected]>
* Make Stats a proto so we can propagate it over gRPC.
Signed-off-by: Tom Wilkie <[email protected]>
* Fixed series tracker
Signed-off-by: Marco Pracucci <[email protected]>
* Track number of samples too
Signed-off-by: Marco Pracucci <[email protected]>
* Propagate the stats via gRPC
Only partially done, still need to merge & record the results in the query frontend.
Signed-off-by: Tom Wilkie <[email protected]>
* Plugged in stats tracker in the query-frontend
Signed-off-by: Marco Pracucci <[email protected]>
* Removed series tracking
Signed-off-by: Marco Pracucci <[email protected]>
* Fixed tests
Signed-off-by: Marco Pracucci <[email protected]>
* Fixed wall time tracking
Signed-off-by: Marco Pracucci <[email protected]>
* Added method and path to log
Signed-off-by: Marco Pracucci <[email protected]>
* Introduced a CLI flag to enable query stats
Signed-off-by: Marco Pracucci <[email protected]>
* Fixed TODOs and linter
Signed-off-by: Marco Pracucci <[email protected]>
* Updated doc and CHANGELOG
Signed-off-by: Marco Pracucci <[email protected]>
* Rolledback samples tracking
Signed-off-by: Marco Pracucci <[email protected]>
* Addressed easy comments
Signed-off-by: Marco Pracucci <[email protected]>
* Moved query stats reporter to frontend transport.Handler
Signed-off-by: Marco Pracucci <[email protected]>
* Renamed query stats log fields
Signed-off-by: Marco Pracucci <[email protected]>
* Improved log message
Signed-off-by: Marco Pracucci <[email protected]>
* Updated CHANGELOG
Signed-off-by: Marco Pracucci <[email protected]>
Co-authored-by: Marco Pracucci <[email protected]>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,7 @@
9
9
- limit for outgoing gRPC messages has changed from 2147483647 to 16777216 bytes
10
10
- limit for incoming gRPC messages has changed from 4194304 to 104857600 bytes
11
11
*[FEATURE] Distributor/Ingester: Provide ability to not overflow writes in the presence of a leaving or unhealthy ingester. This allows for more efficient ingester rolling restarts. #3305
12
+
*[FEATURE] Query-frontend: introduced query statistics logged in the query-frontend when enabled via `-frontend.query-stats-enabled=true`. When enabled, the metric `cortex_query_seconds_total` is tracked, counting the sum of the wall time spent across all queriers while running queries (on a per-tenant basis). The metrics `cortex_request_duration_seconds` and `cortex_query_seconds_total` are different: the first one tracks the request duration (eg. HTTP request from the client), while the latter tracks the sum of the wall time on all queriers involved executing the query. #3539
12
13
*[ENHANCEMENT] API: Add GZIP HTTP compression to the API responses. Compression can be enabled via `-api.response-compression-enabled`. #3536
13
14
*[ENHANCEMENT] Added zone-awareness support on queries. When zone-awareness is enabled, queries will still succeed if all ingesters in a single zone will fail. #3414
14
15
*[ENHANCEMENT] Blocks storage ingester: exported more TSDB-related metrics. #3412
f.DurationVar(&cfg.LogQueriesLongerThan, "frontend.log-queries-longer-than", 0, "Log queries that are slower than the specified duration. Set to 0 to disable. Set to < 0 to enable on all queries.")
41
47
f.Int64Var(&cfg.MaxBodySize, "frontend.max-body-size", 10*1024*1024, "Max body size for downstream prometheus.")
48
+
f.BoolVar(&cfg.QueryStatsEnabled, "frontend.query-stats-enabled", false, "True to enable query statistics tracking. When enabled, a message with some statistics is logged for every query. This configuration option must be set both on query-frontend and querier.")
42
49
}
43
50
44
51
// Handler accepts queries and forwards them to RoundTripper. It can log slow queries,
0 commit comments