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

Documentation Rewrite #982

Merged
merged 72 commits into from
Sep 25, 2019
Merged
Changes from 1 commit
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
a2de08c
docs: create structure of docs overhaul
rfratto Sep 6, 2019
45bab6f
docs: add design docs back in
rfratto Sep 6, 2019
00619ef
docs: add community documentation
rfratto Sep 6, 2019
645762a
docs: add LogQL docs
rfratto Sep 6, 2019
7690e1d
docs: port existing operations documentation
rfratto Sep 9, 2019
d8ae8e8
docs: add new placeholder file for promtail configuration docs
rfratto Sep 9, 2019
0b3dff8
docs: add TOC for operations/storage
rfratto Sep 9, 2019
29c1df3
docs: add Loki API documentation
rfratto Sep 9, 2019
3a04846
docs: port troubleshooting document
rfratto Sep 9, 2019
ae76437
docs: add docker-driver documentation
rfratto Sep 10, 2019
3a3bebe
docs: link to configuration from main docker-driver document
rfratto Sep 10, 2019
dd4f217
docs: update API for new paths
rfratto Sep 10, 2019
67f104b
docs: fix broken links in api.md and remove json marker from examples
rfratto Sep 10, 2019
7720827
docs: incorporate api changes from #1009
rfratto Sep 11, 2019
3e76241
docs: port promtail documentation
rfratto Sep 12, 2019
01c4b72
docs: add TOC to promtail configuration reference
rfratto Sep 12, 2019
0e5a408
docs: fix promtail spelling errors
rfratto Sep 12, 2019
dfa8b6b
docs: add loki configuration reference
rfratto Sep 12, 2019
8b8d7cc
docs: add TOC to configuration
rfratto Sep 12, 2019
f0c9cf1
docs: add loki configuration example
rfratto Sep 13, 2019
938a679
docs: add Loki overview with brief explanation about each component
rfratto Sep 13, 2019
2a08cfa
docs: add comparisons document
rfratto Sep 13, 2019
0e0f526
docs: add info on table manager and update storage/README.md
rfratto Sep 13, 2019
564dcbd
docs: add getting started
rfratto Sep 16, 2019
0821f38
docs: incorporate config yaml changes from #755
rfratto Sep 16, 2019
398f4e1
docs: fix typo in releases url for promtail
rfratto Sep 17, 2019
d4f2e98
docs: add installation instructions
rfratto Sep 17, 2019
dd979d6
docs: add more configuration examples
rfratto Sep 17, 2019
de50e45
docs: add information on fluentd client
rfratto Sep 17, 2019
9cf01a4
docs: PR review feedback
rfratto Sep 17, 2019
7291b2c
docs: add architecture document
rfratto Sep 18, 2019
276bdae
docs: add missing information from old docs
rfratto Sep 18, 2019
f23fd99
`localy` typo
rfratto Sep 18, 2019
c12c929
docs: s/ran/run/g
rfratto Sep 18, 2019
0e6f789
Typo
pstibrany Sep 19, 2019
fe09d98
Typo
pstibrany Sep 19, 2019
e0015b1
Tyop
pstibrany Sep 19, 2019
6961bd9
Typo
pstibrany Sep 19, 2019
1c2d1c3
docs: fixed typo
pstibrany Sep 19, 2019
133796a
docs: PR feedback
rfratto Sep 19, 2019
c7b6b76
docs: @cyriltovena PR feedback
rfratto Sep 19, 2019
00357fe
docs: add more details to promtail url config option
rfratto Sep 20, 2019
b9c45bd
docs: expand promtail's pipelines document with extra detail
rfratto Sep 20, 2019
3fe341f
docs: fixed some spelling
pstibrany Sep 20, 2019
7a447f9
docs: remove reference to Stage interface in pipelines.md
rfratto Sep 20, 2019
012dc06
docs: clarify promtail configuration and scraping
rfratto Sep 20, 2019
5b9226f
docs: attempt #2 at explaining promtail's usage of machine hostname
rfratto Sep 20, 2019
5c0f523
docs: spelling fixes
pstibrany Sep 20, 2019
4034a3e
docs: add reference to promtail custom metrics and fix silly typo
rfratto Sep 20, 2019
bd4b360
docs: cognizant -> aware
rfratto Sep 20, 2019
dc893fa
docs: typo
pstibrany Sep 20, 2019
3bbaf35
docs: typos
pstibrany Sep 20, 2019
9d76dc1
docs: add which components expose which API endpoints in microservice…
rfratto Sep 20, 2019
e946c19
docs: change ksonnet installation to tanka
rfratto Sep 20, 2019
84d97dd
docs: address most @pracucci feedback
rfratto Sep 23, 2019
d3384bb
docs: fix all spelling errors so reviewers don't have to keep finding…
rfratto Sep 23, 2019
d0026d5
docs: incorporate changes to API endpoints made in #1022
rfratto Sep 23, 2019
48f75ef
docs: add missing loki metrics
rfratto Sep 23, 2019
87139c2
docs: add missing promtail metrics
rfratto Sep 23, 2019
fce9154
docs: @pstribrany feedback
rfratto Sep 24, 2019
a733358
docs: more @pracucci feedback
rfratto Sep 24, 2019
723dfde
docs: move metrics into a table
rfratto Sep 24, 2019
43168b9
docs: update push path references to /loki/api/v1/push
rfratto Sep 24, 2019
bb0eb6e
docs: add detail to further explain limitations of monolithic mode
rfratto Sep 24, 2019
b00c91d
docs: add alternative names to modes_of_operation diagram
rfratto Sep 24, 2019
7cc7bfd
docs: add log ordering requirement
rfratto Sep 24, 2019
d00243d
docs: add procedure for updating docs with latest version
rfratto Sep 24, 2019
65254ac
docs: separate out stages documentation into one document per stage
rfratto Sep 24, 2019
5852035
docs: list supported stores in storage documentation
rfratto Sep 25, 2019
13086c5
docs: add info on duplicate log lines in pipelines
rfratto Sep 25, 2019
5cc963e
docs: add line_format as key feature to fluentd
rfratto Sep 25, 2019
9c432f3
docs: hopefully final commit :)
rfratto Sep 25, 2019
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
Prev Previous commit
Next Next commit
docs: update API for new paths
  • Loading branch information
rfratto committed Sep 25, 2019
commit dd4f217058ce976aab900116e08ef2b2358e3d16
132 changes: 68 additions & 64 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ out of scope for Loki.

The HTTP API includes the following endpoints:

- [`GET /api/v1/query`](#get-/api/v1/query)
- [`GET /api/v1/query_range`](#get-/api/v1/query_range)
- [`GET /api/v1/label`](#get-/api/v1/label)
- [`GET /api/v1/label/<name>/values`](#get-/api/v1/label/<name>/values)
- [`GET /loki/api/v1/query`](#get-/loki/api/v1/query)
- [`GET /loki/api/v1/query_range`](#get-/loki/api/v1/query_range)
- [`GET /loki/api/v1/label`](#get-/loki/api/v1/label)
- [`GET /loki/api/v1/label/<name>/values`](#get-/loki/api/v1/label/<name>/values)
- [`GET /loki/api/v1/tail`](#get-/loki/api/v1/tail)
- [`GET /api/prom/query`](#get-/api/prom/query)
- [`POST /api/prom/push`](#post-/api/prom/push)
- [`GET /api/prom/tail`](#get-/api/prom/tail)
- [`GET /ready`](#get-/ready)
- [`GET /flush`](#get-/flush)
- [`GET /metrics`](#get-/metrics)

[Example clients](#example-clients) can be found at the bottom of this document.

## `GET /api/v1/query`
## `GET /loki/api/v1/query`

`/api/v1/query` allows for doing queries against a single point in time. The URL
`/loki/api/v1/query` allows for doing queries against a single point in time. The URL
query parameters support the following values:

- `query`: The [LogQL](./logql.md) query to perform
Expand Down Expand Up @@ -70,7 +70,7 @@ And `<stream value>` is:
### Examples

```bash
$ curl -G -s "http://localhost:3100/api/v1/query" --data-urlencode 'query=sum(rate({job="varlogs"}[10m])) by (level)' | jq
$ curl -G -s "http://localhost:3100/loki/api/v1/query" --data-urlencode 'query=sum(rate({job="varlogs"}[10m])) by (level)' | jq
{
"resultType": "vector",
"result": [
Expand Down Expand Up @@ -104,7 +104,7 @@ $ curl -G -s "http://localhost:3100/api/v1/query" --data-urlencode 'query=sum(r
```

```bash
$ curl -G -s "http://localhost:3100/api/v1/query" --data-urlencode 'query={job="varlogs"}' | jq
$ curl -G -s "http://localhost:3100/loki/api/v1/query" --data-urlencode 'query={job="varlogs"}' | jq
{
"resultType": "streams",
"result": [
Expand All @@ -125,9 +125,9 @@ $ curl -G -s "http://localhost:3100/api/v1/query" --data-urlencode 'query={job=
}
```

## `GET /api/v1/query_range`
## `GET /loki/api/v1/query_range`

`/api/v1/query_range` is used to do a query over a range of time and
`/loki/api/v1/query_range` is used to do a query over a range of time and
accepts the following query parameters in the URL:

- `query`: The [LogQL](./logql.md) query to perform
Expand Down Expand Up @@ -183,7 +183,7 @@ And `<stream value>` is:
### Examples

```bash
$ curl -G -s "http://localhost:3100/api/v1/query_range" --data-urlencode 'query=sum(rate({job="varlogs"}[10m])) by (level)' --data-urlencode 'step=300' | jq
$ curl -G -s "http://localhost:3100/loki/api/v1/query_range" --data-urlencode 'query=sum(rate({job="varlogs"}[10m])) by (level)' --data-urlencode 'step=300' | jq
{
"resultType": "matrix",
"result": [
Expand Down Expand Up @@ -230,7 +230,7 @@ $ curl -G -s "http://localhost:3100/api/v1/query_range" --data-urlencode 'query
```

```bash
$ curl -G -s "http://localhost:3100/api/v1/query_range" --data-urlencode 'query={job="varlogs"}' | jq
$ curl -G -s "http://localhost:3100/loki/api/v1/query_range" --data-urlencode 'query={job="varlogs"}' | jq
{
"resultType": "streams",
"result": [
Expand All @@ -251,9 +251,9 @@ $ curl -G -s "http://localhost:3100/api/v1/query_range" --data-urlencode 'query
}
```

## `GET /api/v1/label`
## `GET /loki/api/v1/label`

`/api/v1/label` retrieves the list of known labels within a given time span. It
`/loki/api/v1/label` retrieves the list of known labels within a given time span. It
accepts the following query parameters in the URL:

- `start`: The start time for the query as a nanosecond Unix epoch. Defaults to 6 hours ago.
Expand All @@ -273,7 +273,7 @@ Response:
### Examples

```bash
$ curl -G -s "http://localhost:3100/api/v1/label" | jq
$ curl -G -s "http://localhost:3100/loki/api/v1/label" | jq
{
"values": [
"foo",
Expand All @@ -283,9 +283,9 @@ $ curl -G -s "http://localhost:3100/api/v1/label" | jq
}
```

## `GET /api/v1/label/<name>/values`
## `GET /loki/api/v1/label/<name>/values`

`/api/v1/label/<name>/values` retrieves the list of known values for a given
`/loki/api/v1/label/<name>/values` retrieves the list of known values for a given
label within a given time span. It accepts thw following query parameters in
the URL:

Expand All @@ -306,7 +306,7 @@ Response:
### Examples

```bash
$ curl -G -s "http://localhost:3100/api/v1/label/foo/values" | jq
$ curl -G -s "http://localhost:3100/loki/api/v1/label/foo/values" | jq
{
"values": [
"cat",
Expand All @@ -316,6 +316,54 @@ $ curl -G -s "http://localhost:3100/api/v1/label/foo/values" | jq
}
```

## `GET /loki/api/v1/tail`

Alias (DEPRECATED): `GET /api/prom/tail`

`/loki/api/v1/tail` is a websocket endpoint that will stream log messsages based on
a query. It accepts the following query parameters in the URL:

- `query`: The [LogQL](./logql.md) query to perform
- `delay_for`: The number of seconds to delay retrieving logs to let slow
loggers catch up. Defaults to 0 and cannot be larger than 5.
- `limit`: The max number of entries to return
- `start`: The start time for the query as a nanosecond Unix epoch. Defaults to one hour ago.

Response (streamed):

```json
{
"streams": [
{
"labels": "<LogQL label key-value pairs>",
"entries": [
{
"ts": "<RFC3339Nano timestamp>",
"line": "<log line>"
}
]
}
],
"dropped_entries": [
{
"Timestamp": "<RFC3339Nano timestamp>",
"Labels": "<LogQL label key-value pairs>"
}
]
}
```

`dropped_entries` will be populated when the tailer could not keep up with the
amount of traffic in Loki. When present, it indicates that the entries received
in the streams is not the full amount of logs that are present in Loki. Note
that the keys in `dropped_entries` will be sent as uppercase `Timestamp`
and `Labels` instead of `labels` and `ts` like in the entries for the stream.

As the response is streamed, the object defined by the response format above
will be sent over the websocket multiple times.



## `GET /api/prom/query`

`/api/prom/query` supports doing general queries. The URL query parameters
Expand All @@ -331,7 +379,7 @@ support the following values:
Note that the larger the time span between `start` and `end` will cause
additional load on Loki and the index store, resulting in slower queries.

`/api/prom/query` is DEPRECATED and `/api/v1/query_range` should be used
`/api/prom/query` is DEPRECATED and `/loki/api/v1/query_range` should be used
instead.

Response:
Expand Down Expand Up @@ -412,50 +460,6 @@ $ curl -H "Content-Type: application/json" -XPOST -s "https://localhost:3100/api
'{"streams": [{ "labels": "{foo=\"bar\"}", "entries": [{ "ts": "2018-12-18T08:28:06.801064-04:00", "line": "fizzbuzz" }] }]}'
```

## `GET /api/prom/tail`

`/api/prom/tail` is a websocket endpoint that will stream log messsages based on
a query. It accepts the following query parameters in the URL:

- `query`: The [LogQL](./logql.md) query to perform
- `delay_for`: The number of seconds to delay retrieving logs to let slow
loggers catch up. Defaults to 0 and cannot be larger than 5.
- `limit`: The max number of entries to return
- `start`: The start time for the query as a nanosecond Unix epoch. Defaults to one hour ago.

Response (streamed):

```json
{
"streams": [
{
"labels": "<LogQL label key-value pairs>",
"entries": [
{
"ts": "<RFC3339Nano timestamp>",
"line": "<log line>"
}
]
}
],
"dropped_entries": [
{
"Timestamp": "<RFC3339Nano timestamp>",
"Labels": "<LogQL label key-value pairs>"
}
]
}
```

`dropped_entries` will be populated when the tailer could not keep up with the
amount of traffic in Loki. When present, it indicates that the entries received
in the streams is not the full amount of logs that are present in Loki. Note
that the keys in `dropped_entries` will be sent as uppercase `Timestamp`
and `Labels` instead of `labels` and `ts` like in the entries for the stream.

As the response is streamed, the object defined by the response format above
will be sent over the websocket multiple times.

## `GET /ready`

`/ready` returns HTTP 200 when the Loki ingester is ready to accept traffic. If
Expand Down