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 support to log slow queries in Frontend (#1744)
* Add support of logging slow queries
Signed-off-by: Praveen Shukla <praveen.shukla.c42@gmail.com>
* Update orgId, URL and time-taken field in query logging
Signed-off-by: Praveen Shukla <praveen.shukla.c42@gmail.com>
* Update default value as 0 and disable slow query logging disabled
Signed-off-by: Praveen Shukla <praveen.shukla.c42@gmail.com>
* Add slow log feature in changelog
Signed-off-by: Praveen Shukla <praveen.shukla.c42@gmail.com>
* Update slow query CLI flag to use frontend scope instead of querier
Signed-off-by: Praveen Shukla <praveen.shukla.c42@gmail.com>
* Update org_id in slow query logs and add more info in flag description
Signed-off-by: Praveen Shukla <praveen.shukla.c42@gmail.com>
* Add info log for slow query
Signed-off-by: Praveen Shukla <praveen.shukla.c42@gmail.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,7 @@
11
11
*`-ingester.max-global-series-per-metric`
12
12
*[FEATURE] Flush chunks with stale markers early with `ingester.max-stale-chunk-idle`. #1759
13
13
*[FEATURE] EXPERIMENTAL: Added new KV Store backend based on memberlist library. Components can gossip about tokens and ingester states, instead of using Consul or Etcd. #1721
14
+
*[FEATURE] Allow Query Frontend to log slow queries with `frontend.log-queries-longer-than`. #1744
14
15
*[ENHANCEMENT] Allocation improvements in adding samples to Chunk. #1706
15
16
*[ENHANCEMENT] Consul client now follows recommended practices for blocking queries wrt returned Index value. #1708
16
17
*[ENHANCEMENT] Consul client can optionally rate-limit itself during Watch (used e.g. by ring watchers) and WatchPrefix (used by HA feature) operations. Rate limiting is disabled by default. New flags added: `--consul.watch-rate-limit`, and `--consul.watch-burst-size`. #1708
// RegisterFlags adds the flags required to config this to the given FlagSet.
51
54
func (cfg*Config) RegisterFlags(f*flag.FlagSet) {
52
55
f.IntVar(&cfg.MaxOutstandingPerTenant, "querier.max-outstanding-requests-per-tenant", 100, "Maximum number of outstanding requests per tenant per frontend; requests beyond this error with HTTP 429.")
f.StringVar(&cfg.DownstreamURL, "frontend.downstream-url", "", "URL of downstream Prometheus.")
58
+
f.DurationVar(&cfg.LogQueriesLongerThan, "frontend.log-queries-longer-than", 0, "Log queries that are slower than the specified duration. 0 to disable.")
55
59
}
56
60
57
61
// Frontend queues HTTP requests, dispatches them to backends, and handles retries
0 commit comments