Skip to content

Commit

Permalink
TOC Sync: Move API docs under Reference.
Browse files Browse the repository at this point in the history
  • Loading branch information
JStickler committed May 3, 2023
1 parent 233e525 commit 7f8d0ee
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 15 deletions.
2 changes: 1 addition & 1 deletion docs/sources/alert/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ ruler:

The Ruler supports the following types of storage: `azure`, `gcs`, `s3`, `swift`, `cos` and `local`. Most kinds of storage work with the sharded Ruler configuration in an obvious way, that is, configure all Rulers to use the same backend.

The local implementation reads the rule files off of the local filesystem. This is a read-only backend that does not support the creation and deletion of rules through the [Ruler API]({{<relref "../api/#ruler">}}). Despite the fact that it reads the local filesystem this method can still be used in a sharded Ruler configuration if the operator takes care to load the same rules to every Ruler. For instance, this could be accomplished by mounting a [Kubernetes ConfigMap](https://kubernetes.io/docs/concepts/configuration/configmap/) onto every Ruler pod.
The local implementation reads the rule files off of the local filesystem. This is a read-only backend that does not support the creation and deletion of rules through the [Ruler API]({{<relref "../reference/api/#ruler">}}). Despite the fact that it reads the local filesystem this method can still be used in a sharded Ruler configuration if the operator takes care to load the same rules to every Ruler. For instance, this could be accomplished by mounting a [Kubernetes ConfigMap](https://kubernetes.io/docs/concepts/configuration/configmap/) onto every Ruler pod.

A typical local configuration might look something like:
```
Expand Down
2 changes: 1 addition & 1 deletion docs/sources/clients/fluentd/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ This plugin automatically adds a `fluentd_thread` label with the name of the buf

### `url`

The URL of the Loki server to send logs to. When sending data, the publish path (`../api/loki/v1/push`) will automatically be appended.
The URL of the Loki server to send logs to. When sending data, the publish path (`../reference/api/loki/v1/push`) will automatically be appended.
By default the url is set to `https://logs-prod-us-central1.grafana.net`, the url of the Grafana Labs [hosted Loki](/products/cloud/) service.

#### Proxy Support
Expand Down
12 changes: 6 additions & 6 deletions docs/sources/clients/k6/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ The `Client` class exposes the following instance methods:
| method | description |
| ------ | ----------- |
| `push()` | shortcut for `pushParameterized(5, 800*1024, 1024*1024)` |
| `pushParameterized(streams, minSize, maxSize)` | execute push request ([POST /loki/api/v1/push]({{< relref "../../api/#push-log-entries-to-loki" >}})) |
| `instantQuery(query, limit)` | execute instant query ([GET /loki/api/v1/query]({{< relref "../../api/#query-loki" >}})) |
| `client.rangeQuery(query, duration, limit)` | execute range query ([GET /loki/api/v1/query_range]({{< relref "../../api/#query-loki-over-a-range-of-time" >}})) |
| `client.labelsQuery(duration)` | execute labels query ([GET /loki/api/v1/labels]({{< relref "../../api/#list-labels-within-a-range-of-time" >}})) |
| `client.labelValuesQuery(label, duration)` | execute label values query ([GET /loki/api/v1/label/\<name\>/values]({{< relref "../../api/#list-label-values-within-a-range-of-time" >}})) |
| `client.seriesQuery(matchers, duration)` | execute series query ([GET /loki/api/v1/series]({{< relref "../../api/#list-series" >}})) |
| `pushParameterized(streams, minSize, maxSize)` | execute push request ([POST /loki/api/v1/push]({{< relref "../../reference/api/#push-log-entries-to-loki" >}})) |
| `instantQuery(query, limit)` | execute instant query ([GET /loki/api/v1/query]({{< relref "../../reference/api/#query-loki" >}})) |
| `client.rangeQuery(query, duration, limit)` | execute range query ([GET /loki/api/v1/query_range]({{< relref "../../reference/api/#query-loki-over-a-range-of-time" >}})) |
| `client.labelsQuery(duration)` | execute labels query ([GET /loki/api/v1/labels]({{< relref "../../reference/api/#list-labels-within-a-range-of-time" >}})) |
| `client.labelValuesQuery(label, duration)` | execute label values query ([GET /loki/api/v1/label/\<name\>/values]({{< relref "../../reference/api/#list-label-values-within-a-range-of-time" >}})) |
| `client.seriesQuery(matchers, duration)` | execute series query ([GET /loki/api/v1/series]({{< relref "../../reference/api/#list-series" >}})) |
**Javascript load test example:**
Expand Down
2 changes: 1 addition & 1 deletion docs/sources/clients/k6/query-scenario.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Loki has 5 types of queries:

In a real-world use-case, such as querying Loki using it as a Grafana
datasource, all of these queries are used. Each of them has a different
[API]({{< relref "../../api/_index.md" >}}) endpoint. The xk6-loki extension
[API]({{< relref "../../reference/api.md" >}}) endpoint. The xk6-loki extension
provides a [Javascript API](https://github.com/grafana/xk6-loki#javascript-api)
for all these query types.

Expand Down
2 changes: 1 addition & 1 deletion docs/sources/clients/promtail/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Important details are:

## Loki Push API

Promtail can also be configured to receive logs from another Promtail or any Loki client by exposing the [Loki Push API]({{<relref "../../api#push-log-entries-to-loki">}}) with the [loki_push_api]({{<relref "configuration#loki_push_api">}}) scrape config.
Promtail can also be configured to receive logs from another Promtail or any Loki client by exposing the [Loki Push API]({{<relref "../../reference/api#push-log-entries-to-loki">}}) with the [loki_push_api]({{<relref "configuration#loki_push_api">}}) scrape config.

There are a few instances where this might be helpful:

Expand Down
2 changes: 1 addition & 1 deletion docs/sources/clients/promtail/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,7 @@ max_message_length: <int>

### loki_push_api

The `loki_push_api` block configures Promtail to expose a [Loki push API]({{<relref "../../api#push-log-entries-to-loki">}}) server.
The `loki_push_api` block configures Promtail to expose a [Loki push API]({{<relref "../../reference/api#push-log-entries-to-loki">}}) server.

Each job configured with a `loki_push_api` will expose this API and will require a separate port.

Expand Down
2 changes: 1 addition & 1 deletion docs/sources/operations/storage/logs-deletion.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Log entries that fall within a specified time window and match an optional line

Log entry deletion is supported _only_ when the BoltDB Shipper is configured for the index store.

The compactor component exposes REST [endpoints]({{<relref "../../api/#compactor">}}) that process delete requests.
The compactor component exposes REST [endpoints]({{<relref "../../reference/api/#compactor">}}) that process delete requests.
Hitting the endpoint specifies the streams and the time window.
The deletion of the log entries takes place after a configurable cancellation time period expires.

Expand Down
2 changes: 1 addition & 1 deletion docs/sources/operations/storage/wal.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ When scaling down, we must ensure existing data on the leaving ingesters are flu

Consider you have 4 ingesters `ingester-0 ingester-1 ingester-2 ingester-3` and you want to scale down to 2 ingesters, the ingesters which will be shutdown according to statefulset rules are `ingester-3` and then `ingester-2`.

Hence before actually scaling down in Kubernetes, port forward those ingesters and hit the [`/ingester/flush_shutdown`]({{<relref "../../api#post-ingesterflush_shutdown">}}) endpoint. This will flush the chunks and remove itself from the ring, after which it will register as unready and may be deleted.
Hence before actually scaling down in Kubernetes, port forward those ingesters and hit the [`/ingester/flush_shutdown`]({{<relref "../../reference/api#post-ingesterflush_shutdown">}}) endpoint. This will flush the chunks and remove itself from the ring, after which it will register as unready and may be deleted.

After hitting the endpoint for `ingester-2 ingester-3`, scale down the ingesters to 2.

Expand Down
12 changes: 12 additions & 0 deletions docs/sources/reference/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: Loki reference topics
menuTitle: Reference
description: Reference topics for Loki.
weight: 1100
---

# Loki reference topics

This section provides reference material for Loki.

1. [Loki HTTP API]({{<relref "api.md">}})
7 changes: 5 additions & 2 deletions docs/sources/api/_index.md → docs/sources/reference/api.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
---
title: Grafana Loki HTTP API
menuTitle: "HTTP API"
description: "Loki exposes REST endpoints for operating on a Loki cluster. This section details the endpoints."
weight: 900
description: Loki exposes REST endpoints for operating on a Loki cluster. This section details the endpoints.
aliases:
- /docs/loki/latest/api
- /docs/loki/latest/reference
weight: 100
---

# Grafana Loki HTTP API
Expand Down

0 comments on commit 7f8d0ee

Please sign in to comment.