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

docs: Recommended quickstart changes + Upgrade #13747

Merged
merged 10 commits into from
Aug 13, 2024
104 changes: 66 additions & 38 deletions docs/sources/get-started/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ killercoda:
replacement: evaluate-loki_${1}_
title: Loki Quickstart Demo
description: This sandbox provides an online enviroment for testing the Loki quickstart demo.
details:
finish:
text: finish.md
backend:
imageid: ubuntu
---
Expand Down Expand Up @@ -48,34 +45,22 @@ The Docker Compose configuration runs the following components, each in its own

<!-- INTERACTIVE page intro.md END -->

<!-- INTERACTIVE ignore START -->
## Before you begin

{{< admonition type="tip" >}}
Alternatively, you can try out this example in our interactive learning environment: [Loki Quickstart Sandbox](https://killercoda.com/grafana-labs/course/loki/loki-quickstart).

It's a fully configured environment with all the dependencies already installed.

![Interactive](https://raw.githubusercontent.com/grafana/killercoda/prod/assets/loki-ile.svg)
{{< /admonition >}}

- Install [Docker](https://docs.docker.com/install)
- Install [Docker Compose](https://docs.docker.com/compose/install)

## Interactive Learning Environment

{{< admonition type="note" >}}
The Interactive Learning Environment is in trial.
![Interactive](/media/docs/loki/loki-ile.svg)

Provide feedback, report bugs, and raise issues in the [Grafana Killercoda repository](https://github.com/grafana/killercoda).
{{< /admonition >}}

Try out this demo within our interactive learning environment: [Loki Quickstart Sandbox](https://killercoda.com/grafana-labs/course/loki/loki-quickstart)

- You must have a free Killercoda account to verify you aren't a bot.
- Tutorial instructions are located on the left-side of the screen.
Click to move on to the next section.
- All commands run inside the interactive terminal.
- You can access Grafana with the URL links provided within the sandbox.
- Install [Docker](https://docs.docker.com/install)
Jayclifford345 marked this conversation as resolved.
Show resolved Hide resolved
- Install [Docker Compose](https://docs.docker.com/compose/install)
<!-- INTERACTIVE ignore END -->

<!-- INTERACTIVE page step1.md START -->

Expand Down Expand Up @@ -140,8 +125,6 @@ This quickstart assumes you are running Linux.

At the end of the command, you should see something similar to the following:

<!-- INTERACTIVE ignore START -->

```console
✔ Network evaluate-loki_loki Created 0.1s
✔ Container evaluate-loki-minio-1 Started 0.6s
Expand All @@ -154,22 +137,6 @@ This quickstart assumes you are running Linux.
✔ Container evaluate-loki-alloy-1 Started 1.4s
```

<!-- INTERACTIVE ignore END -->

{{< docs/ignore >}}

```console
Creating evaluate-loki_flog_1 ... done
Creating evaluate-loki_minio_1 ... done
Creating evaluate-loki_read_1 ... done
Creating evaluate-loki_write_1 ... done
Creating evaluate-loki_gateway_1 ... done
Creating evaluate-loki_alloy_1 ... done
Creating evaluate-loki_grafana_1 ... done
Creating evaluate-loki_backend_1 ... done
```

{{< /docs/ignore >}}

1. (Optional) Verify that the Loki cluster is up and running.

Expand All @@ -181,6 +148,13 @@ This quickstart assumes you are running Linux.
1. (Optional) Verify that Grafana Alloy is running.
- You can access the Grafana Alloy UI at [http://localhost:12345](http://localhost:12345).

1. (Optional) You can check all the containers are running by running the following command:
<!-- INTERACTIVE exec START -->
```bash
docker ps -a
```
<!-- INTERACTIVE exec END -->

<!-- INTERACTIVE page step1.md END -->

<!-- INTERACTIVE page step2.md START -->
Expand Down Expand Up @@ -316,12 +290,66 @@ To see every log line that doesn't contain the text `401`:

For more examples, refer to the [query documentation](https://grafana.com/docs/loki/<LOKI_VERSION>/query/query_examples/).

## Loki data source in Grafana

In this example, the Loki data source is already configured in Grafana. This can be seen within the `docker-compose.yaml` file:

```yaml
grafana:
image: grafana/grafana:latest
environment:
- GF_PATHS_PROVISIONING=/etc/grafana/provisioning
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
depends_on:
- gateway
entrypoint:
- sh
- -euc
- |
mkdir -p /etc/grafana/provisioning/datasources
cat <<EOF > /etc/grafana/provisioning/datasources/ds.yaml
apiVersion: 1
datasources:
- name: Loki
type: loki
access: proxy
url: http://gateway:3100
jsonData:
httpHeaderName1: "X-Scope-OrgID"
secureJsonData:
httpHeaderValue1: "tenant1"
EOF
/run.sh
```
Within the entrypoint section, the Loki data source is configured with the following details:
- Name: Loki (name of the data source)
- Type: loki (type of data source)
- Access: proxy (access type)
- URL: http://gateway:3100 (URL of the Loki data source. Loki uses a nginx gateway to direct traffic to the appropriate component)
- jsonData: httpHeaderName1: "X-Scope-OrgID" (header name for the organization ID)
- secureJsonData: httpHeaderValue1: "tenant1" (header value for the organization ID)
Jayclifford345 marked this conversation as resolved.
Show resolved Hide resolved

It is important to note when Loki is configured in any other mode other than monolithic deployment, a tenant ID is required to be passed in the header. Without this, queries will return an authorization error.
Jayclifford345 marked this conversation as resolved.
Show resolved Hide resolved

<!-- INTERACTIVE page step2.md END -->

<!-- INTERACTIVE page finish.md START -->

## Complete metrics, logs, traces, and profiling example

You have completed the Loki Quickstart demo. So where to go next?

{{< docs/ignore >}}
## Back to docs
Head back to wear you started from to continue with the Loki documentation: [Loki documentation](https://grafana.com/docs/loki/latest/get-started/quick-start/).
Jayclifford345 marked this conversation as resolved.
Show resolved Hide resolved
{{< /docs/ignore >}}

## Complete metrics, logs, traces, and profiling example
If you would like to run a demonstration environment that includes Mimir, Loki, Tempo, and Grafana, you can use [Introduction to Metrics, Logs, Traces, and Profiling in Grafana](https://github.com/grafana/intro-to-mlt).
It's a self-contained environment for learning about Mimir, Loki, Tempo, and Grafana.

The project includes detailed explanations of each component and annotated configurations for a single-instance deployment.
You can also push the data from the environment to [Grafana Cloud](https://grafana.com/cloud/).

<!-- INTERACTIVE page finish.md END -->
8 changes: 4 additions & 4 deletions examples/getting-started/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ networks:

services:
read:
image: grafana/loki:3.0.0
image: grafana/loki:3.1.0
command: "-config.file=/etc/loki/config.yaml -target=read"
ports:
- 3101:3100
Expand All @@ -27,7 +27,7 @@ services:
- loki

write:
image: grafana/loki:3.0.0
image: grafana/loki:3.1.0
command: "-config.file=/etc/loki/config.yaml -target=write"
ports:
- 3102:3100
Expand All @@ -46,7 +46,7 @@ services:
<<: *loki-dns

alloy:
image: grafana/alloy-dev:latest
image: grafana/alloy:latest
volumes:
- ./alloy-local-config.yaml:/etc/alloy/config.alloy:ro
- /var/run/docker.sock:/var/run/docker.sock
Expand Down Expand Up @@ -121,7 +121,7 @@ services:
- loki

backend:
image: grafana/loki:3.0.0
image: grafana/loki:3.1.0
volumes:
- ./loki-config.yaml:/etc/loki/config.yaml
ports:
Expand Down
2 changes: 1 addition & 1 deletion examples/getting-started/loki-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ memberlist:

schema_config:
configs:
- from: 2021-08-01
- from: 2023-01-01
store: tsdb
object_store: s3
schema: v13
Expand Down
Loading