Skip to content

Commit

Permalink
Documented /ready, /metrics and /flush endpoints (#743)
Browse files Browse the repository at this point in the history
  • Loading branch information
pracucci authored and cyriltovena committed Jul 15, 2019
1 parent d5688b5 commit a2ceb8d
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,19 @@ The Loki server has the following API endpoints (_Note:_ Authentication is out o
}
```

- `GET /ready`

This endpoint returns 200 when Loki ingester is ready to accept traffic. If you're running Loki on Kubernetes, this endpoint can be used as readiness probe.

- `GET /flush`

This endpoint triggers a flush of all in memory chunks in the ingester. Mainly used for local testing.

- `GET /metrics`

This endpoint returns Loki metrics for Prometheus. See "[Operations > Observability > Metrics](./operations.md)" to have a list of exported metrics.


## Examples of using the API in a third-party client library

1) Take a look at this [client](https://github.com/afiskon/promtail-client), but be aware that the API is not stable yet (Golang).
Expand Down
22 changes: 22 additions & 0 deletions docs/promtail-api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Promtail API

Promtail features an embedded web server exposing a web console at `/` and the following API endpoints:

- `GET /ready`

This endpoint returns 200 when Promtail is up and running, and there's at least one working target.

- `GET /metrics`

This endpoint returns Promtail metrics for Prometheus. See "[Operations > Observability > Metrics](./operations.md)" to have a list of exported metrics.


## Promtail web server config

The web server exposed by Promtail can be configured in the promtail `.yaml` config file:

```
server:
http_listen_host: 127.0.0.1
http_listen_port: 9080
```
1 change: 1 addition & 0 deletions docs/promtail.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* [Scrape Configs](#scrape-configs)
* [Entry Parsing](#entry-parser)
* [Deployment Methods](./promtail-setup.md)
* [Promtail API](./promtail-api.md)
* [Config and Usage Examples](./promtail-examples.md)
* [Troubleshooting](./troubleshooting.md)

Expand Down

0 comments on commit a2ceb8d

Please sign in to comment.