Skip to content

Commit dedb585

Browse files
sh0rezrfratto
authored andcommitted
docs: general documentation rework
- restructures the docs to make them easier to explore - rewrites promtail docs - unifies, shortens and extends docs
1 parent a2e2272 commit dedb585

16 files changed

+918
-599
lines changed

docs/api.md

-291
This file was deleted.
File renamed without changes.

docs/index.md

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<p align="center">
2+
<img src="logo_and_name.png" alt="Loki Logo"> <br>
3+
<small>Like Prometheus, but for logs!</small>
4+
</p>
5+
6+
Grafana Loki is a set of components, that can be composed into a fully featured logging stack.
7+
8+
It builds around the idea of treating a single log line as-is. This means that
9+
instead of full-text indexing them, related logs are grouped using the same labels
10+
as in Prometheus. This is much more efficient and scales better.
11+
12+
## Components
13+
- **[Loki](loki/overview.md)**: The main server component is called Loki. It is responsible for
14+
permanently storing the logs it is being shipped and it executes the LogQL
15+
queries from clients.
16+
Loki shares its high-level architecture with Cortex, a highly scalable
17+
Prometheus backend.
18+
- **[Promtail](promtail/overview.md)**: To ship logs to a central place, an agent is required. Promtail
19+
is deployed to every node that should be monitored and sends the logs to Loki.
20+
It also does important task of pre-processing the log lines, including
21+
attaching labels to them for easier querying.
22+
- *Grafana*: The *Explore* feature of Grafana 6.0+ is the primary place of
23+
contact between a human and Loki. It is used for discovering and analyzing logs.
24+
25+
Alongside these main components, there are some other ones as well:
26+
27+
- **[LogCLI](logcli.md)**: A command line interface to query logs and labels from Loki
28+
- **Canary**: An audit utility to analyze the log-capturing performance of Loki.
29+
Ingests data into Loki and immediately reads it back to check for latency and loss.
30+
- **Docker Driver**: A Docker [log driver](https://docs.docker.com/config/containers/logging/configure/) to ship logs captured by Docker
31+
directly to Loki, without the need of an agent.
32+
- **Fluentd Plugin**: An Fluentd [output
33+
plugin](https://docs.fluentd.org/output), to use Fluentd for shipping logs
34+
into Loki

docs/logcli.md

+19-16
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
1-
# Log CLI usage Instructions
1+
# LogCLI
22

3-
Loki's main query interface is Grafana; however, a basic CLI is provided as a proof of concept.
4-
5-
Once you have Loki running in a cluster, you can query logs from that cluster.
3+
LogCLI is a handy tool to query logs from Loki without having to run a full Grafana instance.
64

75
## Installation
86

9-
### Get latest version
7+
### Binary (Recommended)
8+
Head over to the [Releases](https://github.com/grafana/loki/releases) and download the `logcli` binary for your OS:
9+
```bash
10+
# download a binary (adapt app, os and arch as needed)
11+
# installs v0.2.0. For up to date URLs refer to the release's description
12+
$ curl -fSL -o "/usr/local/bin/logcli.gz" "https://github.com/grafana/logcli/releases/download/v0.2.0/logcli-linux-amd64.gz"
13+
$ gunzip "/usr/local/bin/logcli.gz"
1014

11-
```
12-
$ go get github.com/grafana/loki/cmd/logcli
15+
# make sure it is executable
16+
$ chmod a+x "/usr/local/bin/logcli"
1317
```
1418

15-
### Build from source
19+
### From source
1620

1721
```
18-
$ go get github.com/grafana/loki
19-
$ cd $GOPATH/src/github.com/grafana/loki
20-
$ go build ./cmd/logcli
22+
$ go get github.com/grafana/loki/cmd/logcli
2123
```
2224

2325
Now `logcli` is in your current directory.
@@ -36,14 +38,15 @@ Otherwise, when running e.g. [locally](https://github.com/grafana/loki/tree/mast
3638
```
3739
$ export GRAFANA_ADDR=http://localhost:3100
3840
```
39-
> Note: If you are running loki behind a proxy server and have an authentication setup. You will have to pass URL, username and password accordingly. Please refer to the [docs](https://github.com/adityacs/loki/blob/master/docs/operations.md) for more info.
41+
> Note: If you are running loki behind a proxy server and have an authentication setup, you will have to pass URL, username and password accordingly. Please refer to [Authentication](loki/operations.md#authentication) for more info.
4042
41-
```
43+
```bash
4244
$ logcli labels job
4345
https://logs-dev-ops-tools1.grafana.net/api/prom/label/job/values
4446
cortex-ops/consul
4547
cortex-ops/cortex-gw
4648
...
49+
4750
$ logcli query '{job="cortex-ops/consul"}'
4851
https://logs-dev-ops-tools1.grafana.net/api/prom/query?query=%7Bjob%3D%22cortex-ops%2Fconsul%22%7D&limit=30&start=1529928228&end=1529931828&direction=backward&regexp=
4952
Common labels: {job="cortex-ops/consul", namespace="cortex-ops"}
@@ -55,14 +58,14 @@ Common labels: {job="cortex-ops/consul", namespace="cortex-ops"}
5558

5659
Configuration values are considered in the following order (lowest to highest):
5760

58-
- environment value
59-
- command line
61+
- Environment variables
62+
- Command line flags
6063

6164
The URLs of the requests are printed to help with integration work.
6265

6366
### Details
6467

65-
```console
68+
```bash
6669
$ logcli help
6770
usage: logcli [<flags>] <command> [<args> ...]
6871

0 commit comments

Comments
 (0)