Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documented /ready, /metrics and /flush endpoints #743

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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