Skip to content

Commit

Permalink
docs: Add instructions for configuring request logging
Browse files Browse the repository at this point in the history
Signed-off-by: Philip Gough <philip.p.gough@gmail.com>
  • Loading branch information
philipgough committed Dec 8, 2021
1 parent c9d7465 commit 0302a89
Showing 1 changed file with 75 additions and 0 deletions.
75 changes: 75 additions & 0 deletions docs/logging.md
@@ -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
```

0 comments on commit 0302a89

Please sign in to comment.