-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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: Getting started rewrite #16497
base: main
Are you sure you want to change the base?
Conversation
💻 Deploy preview available: https://deploy-preview-loki-16497-zb444pucvq-vp.a.run.app/docs/loki/latest/ |
@JStickler, for some reason, the tests keep failing on this one. We are ready for review, happy to discuss these changes on our call together as it was quite a big change to the getting started guide. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only made it through the docs before I ran out of time. I'll look at the KillerCoda tomorrow.
Co-authored-by: J Stickler <[email protected]> Signed-off-by: Jay Clifford <[email protected]>
Aaah thanks @JStickler! All changes are accepted, and the killercoda has been updated for your testing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made it through both the docs/local install and the Killercoda today.
If you want to experiment with Loki, you can run Loki locally using the Docker Compose file that ships with Loki. It runs Loki in a [monolithic deployment](https://grafana.com/docs/loki/<LOKI_VERSION>/get-started/deployment-modes/#monolithic-mode) mode and includes a sample application to generate logs. | ||
|
||
The Docker Compose configuration runs the following components, each in its own container: | ||
This quick start guide will walk you through deploying Loki in single binary mode (also known as [monolithic mode](https://grafana.com/docs/loki/<LOKI_VERSION>/get-started/deployment-modes/#monolithic-mode)) using Docker Compose. Grafana Loki is only one component of the Grafana observability stack for logs. In this tutorial we will refer to this stack as the **Loki stack**. The Loki stack consists of the following components: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move the last sentence here (The Loki stack consists of the following components:) down below the graphic? Now that I can see the website preview, not having the lead in right before the bulleted list looks odd.
With the Loki stack running, you can now verify each component is up and running: | ||
|
||
* **Alloy**: Open a browser and navigate to [http://localhost:12345/graph](http://localhost:12345/graph). You should see the Alloy UI. | ||
* **Grafana**: Open a browser and navigate to [http://localhost:3000](http://localhost:3000). You should see the Grafana home page. | ||
* **Loki**: Open a browser and navigate to [http://localhost:3100/metrics](http://localhost:3100/metrics). You should see the Loki metrics page. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check my spacing on the bullets in the preview. I think I've got the indentation correct.
With the Loki stack running, you can now verify each component is up and running: | |
* **Alloy**: Open a browser and navigate to [http://localhost:12345/graph](http://localhost:12345/graph). You should see the Alloy UI. | |
* **Grafana**: Open a browser and navigate to [http://localhost:3000](http://localhost:3000). You should see the Grafana home page. | |
* **Loki**: Open a browser and navigate to [http://localhost:3100/metrics](http://localhost:3100/metrics). You should see the Loki metrics page. | |
1. With the Loki stack running, you can now verify each component is up and running: | |
* **Alloy**: Open a browser and navigate to [http://localhost:12345/graph](http://localhost:12345/graph). You should see the Alloy UI. | |
* **Grafana**: Open a browser and navigate to [http://localhost:3000](http://localhost:3000). You should see the Grafana home page. | |
* **Loki**: Open a browser and navigate to [http://localhost:3100/metrics](http://localhost:3100/metrics). You should see the Loki metrics page. |
|
||
<!-- INTERACTIVE page step1.md END --> | ||
|
||
<!-- INTERACTIVE page step2.md START --> | ||
|
||
## View your logs in Grafana | ||
Since Grafana Alloy is configured to tail logs from all Docker containers, Loki should already be receiving logs. The best place to verify log collection is using the Grafana Logs Drilldown feature. To do this, navigate to [http://localhost:3000/a/grafana-lokiexplore-app](http://localhost:3000/a/grafana-lokiexplore-app). You should see the Grafana Logs Drilldown page. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm getting a page not found
error when I try to navigate to http://localhost:3000/a/grafana-lokiexplore-app. Do we need to update the docker image to a version with the name change?
|
||
You can access the Grafana cluster by browsing to [http://localhost:3000](http://localhost:3000). | ||
We will not cover the rest of the Grafana Logs Drilldown features in this quickstart guide. For more information on how to use the Grafana Logs Drilldown feature, see [the getting started page](https://grafana.com/docs/grafana/latest/explore/simplified-exploration/logs/get-started/). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to clarify, since we're already on a "getting started" page.
We will not cover the rest of the Grafana Logs Drilldown features in this quickstart guide. For more information on how to use the Grafana Logs Drilldown feature, see [the getting started page](https://grafana.com/docs/grafana/latest/explore/simplified-exploration/logs/get-started/). | |
We will not cover the rest of the Grafana Logs Drilldown features in this quickstart guide. For more information on how to use the Grafana Logs Drilldown feature, see [the Logs Drilldown getting started page](https://grafana.com/docs/grafana/latest/explore/simplified-exploration/logs/get-started/). |
|
||
Once the command completes, you should see a similar output: | ||
|
||
```console |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this needs to be updated? I have five less containers than the sample output shown.
My output was :
✔ Volume "greenhouse_pgdata" Created 0.0s
✔ Container greenhouse-websocket_service-1 Started 0.4s
✔ Container greenhouse-db-1 Started 0.4s
✔ Container greenhouse-user_service-1 Started 0.6s
✔ Container greenhouse-plant_service-1 Started 0.6s
✔ Container greenhouse-bug_service-1 Started 0.6s
✔ Container greenhouse-simulation_service-1 Started 0.8s
✔ Container greenhouse-main_app-1 Started 1.0s
|
||
## Loki data source in Grafana | ||
In this view you can see the components of the Alloy configuration file and how they are connected: | ||
* **discovery.docker**: This component queries the metadata of the docker enviroment via the docker socket and discovers new containers, aswell as providing metdata about the containers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* **discovery.docker**: This component queries the metadata of the docker enviroment via the docker socket and discovers new containers, aswell as providing metdata about the containers. | |
* **discovery.docker**: This component queries the metadata of the docker environment via the docker socket and discovers new containers, as well as providing metadata about the containers. |
In this example, the Loki data source is already configured in Grafana. This can be seen within the `docker-compose.yaml` file: | ||
### View Logs in realtime | ||
|
||
Grafana Alloy provides inbuilt realtime log viewer. This allows you to view current log entries and how they are being transformed via specific components of the pipeline. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grafana Alloy provides inbuilt realtime log viewer. This allows you to view current log entries and how they are being transformed via specific components of the pipeline. | |
Grafana Alloy provides a built-in real time log viewer. This allows you to view current log entries and how they are being transformed via specific components of the pipeline. |
retention_enabled: true | ||
``` | ||
To summarize the configuration file: | ||
* **auth_enabled**: This is set to false, meaning Loki does not need a [tenant ID](https://grafana.com/docs/loki/<LOKI_VERSION>/operations/multi-tenancy/) for ingest or query. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to call out that auth_enabled: true
in the Loki Helm chart so that people don't think they should be running with this setting in production?
* **auth_enabled**: This is set to false, meaning Loki does not need a [tenant ID](https://grafana.com/docs/loki/<LOKI_VERSION>/operations/multi-tenancy/) for ingest or query. | ||
* **server**: Defines the ports Loki listens on, the log level, and the maximum number of concurrent gRPC streams. | ||
* **common**: Defines the common configuration for Loki. This includes the instance address, storage configuration, replication factor, and ring configuration. | ||
* **query_range**: This is defined to tell Loki to use inbuilt caching for query results. In production environments of Loki this is handled by a seperate cache service such as memcached. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* **query_range**: This is defined to tell Loki to use inbuilt caching for query results. In production environments of Loki this is handled by a seperate cache service such as memcached. | |
* **query_range**: This is configured to tell Loki to use inbuilt caching for query results. In production environments of Loki this is handled by a separate cache service such as memcached. |
Head back to where you started from to continue with the Loki documentation: [Loki documentation](https://grafana.com/docs/loki/latest/get-started/quick-start/). | ||
{{< /docs/ignore >}} | ||
|
||
You have completed the Loki Quickstart demo. So where to go next? Here are a few suggestions: | ||
* **Deploy:** Loki can be deployed in multiple ways. For production usecases we recommend deploying Loki via the [Helm chart](https://grafana.com/docs/loki/<LOKI_VERSION>/setup/install/helm/). | ||
* **Send Logs:** In this example we used Grafana Alloy to collect and send logs to Loki. However there are many other methods you can use depending upon your needs. For more information see [send data](https://grafana.com/docs/loki/next/send-data/). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* **Send Logs:** In this example we used Grafana Alloy to collect and send logs to Loki. However there are many other methods you can use depending upon your needs. For more information see [send data](https://grafana.com/docs/loki/next/send-data/). | |
* **Send Logs:** In this example we used Grafana Alloy to collect and send logs to Loki. However there are many other methods you can use depending upon your needs. For more information see [send data](https://grafana.com/docs/loki/<LOKI_VERSION>/send-data/). |
What this PR does / why we need it:
With the focus change to two deployment modes, Monolthic and Microservice, it was time to refresh the quick start guide to Loki. This incorporates much of the same flavour as the original:
But includes newer features:
Aswell as adding the Carnivouse Greehouse example to provide an interactive method to understanding LogQL queries.
Killercoda sample found here: https://killercoda.com/grafana-dev-testing/course/workshops/course-tracker-test
Checklist
CONTRIBUTING.md
guide (required)feat
PRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.docs/sources/setup/upgrade/_index.md
deprecated-config.yaml
anddeleted-config.yaml
files respectively in thetools/deprecated-config-checker
directory. Example PR