Docs: Fix links and formatting of HTTP API page (#5498)

pull/5500/head
Karen Miller 4 years ago committed by GitHub
parent c3edeac990
commit 6f46a8ffeb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 56
      docs/sources/api/_index.md

@ -21,44 +21,28 @@ These endpoints are exposed by all components:
- [`GET /config`](#get-config) - [`GET /config`](#get-config)
- [`GET /loki/api/v1/status/buildinfo`](#get-lokiapiv1statusbuildinfo) - [`GET /loki/api/v1/status/buildinfo`](#get-lokiapiv1statusbuildinfo)
These endpoints are exposed by the querier and the frontend: These endpoints are exposed by the querier and the query frontend:
- [Loki's HTTP API](#lokis-http-api) - [`GET /loki/api/v1/query`](#get-lokiapiv1query)
- [Microservices Mode](#microservices-mode) - [`GET /loki/api/v1/query_range`](#get-lokiapiv1query_range)
- [Matrix, Vector, And Streams](#matrix-vector-and-streams) - [`GET /loki/api/v1/labels`](#get-lokiapiv1labels)
- [`GET /loki/api/v1/query`](#get-lokiapiv1query) - [`GET /loki/api/v1/label/<name>/values`](#get-lokiapiv1labelnamevalues)
- [Examples](#examples) - [`GET /loki/api/v1/tail`](#get-lokiapiv1tail)
- [`GET /loki/api/v1/query_range`](#get-lokiapiv1query_range) - [`POST /loki/api/v1/push`](#post-lokiapiv1push)
- [Step vs Interval](#step-versus-interval) - [`GET /ready`](#get-ready)
- [Examples](#examples-1) - [`GET /metrics`](#get-metrics)
- [`GET /loki/api/v1/labels`](#get-lokiapiv1labels) - **Deprecated** [`GET /api/prom/tail`](#get-apipromtail)
- [Examples](#examples-2) - **Deprecated** [`GET /api/prom/query`](#get-apipromquery)
- [`GET /loki/api/v1/label/<name>/values`](#get-lokiapiv1labelnamevalues) - **Deprecated** [`GET /api/prom/label`](#get-apipromlabel)
- [Examples](#examples-3) - **Deprecated** [`GET /api/prom/label/<name>/values`](#get-apipromlabelnamevalues)
- [`GET /loki/api/v1/tail`](#get-lokiapiv1tail) - **Deprecated** [`POST /api/prom/push`](#post-apiprompush)
- [`POST /loki/api/v1/push`](#post-lokiapiv1push)
- [Examples](#examples-4) These endpoints are exposed by the distributor:
- [`GET /api/prom/tail`](#get-apipromtail)
- [`GET /api/prom/query`](#get-apipromquery)
- [Examples](#examples-5)
- [`GET /api/prom/label`](#get-apipromlabel)
- [Examples](#examples-6)
- [`GET /api/prom/label/<name>/values`](#get-apipromlabelnamevalues)
- [Examples](#examples-7)
- [`POST /api/prom/push`](#post-apiprompush)
- [Examples](#examples-8)
- [`GET /ready`](#get-ready)
- [`GET /metrics`](#get-metrics)
- [Series](#series)
- [Examples](#examples-9)
- [Statistics](#statistics)
While these endpoints are exposed by just the distributor:
- [`POST /loki/api/v1/push`](#post-lokiapiv1push) - [`POST /loki/api/v1/push`](#post-lokiapiv1push)
- [`GET /distributor/ring`](#get-distributorring) - [`GET /distributor/ring`](#get-distributorring)
And these endpoints are exposed by just the ingester: These endpoints are exposed by the ingester:
- [`POST /flush`](#post-flush) - [`POST /flush`](#post-flush)
- [`POST /ingester/flush_shutdown`](#post-ingesterflush_shutdown) - [`POST /ingester/flush_shutdown`](#post-ingesterflush_shutdown)
@ -253,12 +237,12 @@ accepts the following query parameters in the URL:
- `start`: The start time for the query as a nanosecond Unix epoch or another [supported format](#timestamp-formats). Defaults to one hour ago. - `start`: The start time for the query as a nanosecond Unix epoch or another [supported format](#timestamp-formats). Defaults to one hour ago.
- `end`: The end time for the query as a nanosecond Unix epoch or another [supported format](#timestamp-formats). Defaults to now. - `end`: The end time for the query as a nanosecond Unix epoch or another [supported format](#timestamp-formats). Defaults to now.
- `step`: Query resolution step width in `duration` format or float number of seconds. `duration` refers to Prometheus duration strings of the form `[0-9]+[smhdwy]`. For example, 5m refers to a duration of 5 minutes. Defaults to a dynamic value based on `start` and `end`. Only applies to query types which produce a matrix response. - `step`: Query resolution step width in `duration` format or float number of seconds. `duration` refers to Prometheus duration strings of the form `[0-9]+[smhdwy]`. For example, 5m refers to a duration of 5 minutes. Defaults to a dynamic value based on `start` and `end`. Only applies to query types which produce a matrix response.
- `interval`: <span style="background-color:#f3f973;">This parameter is experimental; see the explanation under Step versus Interval.</span> Only return entries at (or greater than) the specified interval, can be a `duration` format or float number of seconds. Only applies to queries which produce a stream response. - `interval`: <span style="background-color:#f3f973;">This parameter is experimental; see the explanation under Step versus interval.</span> Only return entries at (or greater than) the specified interval, can be a `duration` format or float number of seconds. Only applies to queries which produce a stream response.
- `direction`: Determines the sort order of logs. Supported values are `forward` or `backward`. Defaults to `backward.` - `direction`: Determines the sort order of logs. Supported values are `forward` or `backward`. Defaults to `backward.`
In microservices mode, `/loki/api/v1/query_range` is exposed by the querier and the frontend. In microservices mode, `/loki/api/v1/query_range` is exposed by the querier and the frontend.
### Step versus Interval ### Step versus interval
Use the `step` parameter when making metric queries to Loki, or queries which return a matrix response. It is evaluated in exactly the same way Prometheus evaluates `step`. First the query will be evaluated at `start` and then evaluated again at `start + step` and again at `start + step + step` until `end` is reached. The result will be a matrix of the query result evaluated at each step. Use the `step` parameter when making metric queries to Loki, or queries which return a matrix response. It is evaluated in exactly the same way Prometheus evaluates `step`. First the query will be evaluated at `start` and then evaluated again at `start + step` and again at `start + step + step` until `end` is reached. The result will be a matrix of the query result evaluated at each step.

Loading…
Cancel
Save