Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Add instructions for configuring request logging
Signed-off-by: Philip Gough <philip.p.gough@gmail.com>
- Loading branch information
1 parent
c9d7465
commit 0302a89
Showing
1 changed file
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# Logging | ||
|
||
Thanos supports query logging via flags. | ||
|
||
Components are configured using `--request.logging-config-file` to reference to the configuration file or `--request.logging-config` as YAML directly. | ||
|
||
## Configuration | ||
|
||
Configuration can be supplied for either gRPC, HTTP or both. Options can be supplied globally, which is applied to both gRPC and HTTP, or individually to either or both protocols. | ||
|
||
### HTTP | ||
|
||
```yaml | ||
http: | ||
config: | ||
- path: /api/v1/query | ||
port: 10904 | ||
- path: /api/v1/app_range/metrics | ||
port: 3456 | ||
``` | ||
|
||
### gRPC | ||
|
||
```yaml | ||
grpc: | ||
config: | ||
- service: thanos.Store | ||
method: Info | ||
``` | ||
|
||
### Options | ||
|
||
Valid `level` for `options` should be one of `INFO`, `WARNING`, `ERROR` or `DEBUG`. | ||
|
||
```yaml | ||
options: | ||
level: ERROR | ||
decision: | ||
log_start: true | ||
log_end: true | ||
``` | ||
|
||
## How to use `config` flags? | ||
|
||
The following example shows how the logging config can be supplied to the `sidecar` component: | ||
|
||
```yaml | ||
- args: | ||
- sidecar | ||
- | | ||
--objstore.config=type: GCS | ||
config: | ||
bucket: <bucket> | ||
- --prometheus.url=http://localhost:9090 | ||
- | | ||
--request.logging-config=http: | ||
config: | ||
- path: /api/v1/query | ||
port: 10904 | ||
options: | ||
level: INFO | ||
decision: | ||
log_start: true | ||
log_end: true | ||
grpc: | ||
config: | ||
- service: thanos.Store | ||
method: Info | ||
options: | ||
level: ERROR | ||
decision: | ||
log_start: true | ||
log_end: true | ||
- --tsdb.path=/prometheus-data | ||
``` |