Grafana Loki
Grafana Loki is a log aggregation system designed to store and query logs from all your applications and infrastructure.
env0 has the ability to send all of your deployment logs directly to Grafana Loki.
Setup
In order to set up Granfana Loki you will need to get the following data:
- The Host URL
- Authorization username and password
Grafana Cloud
If you're using Grafana Cloud follow these steps to get the relevant data:
- On the left side menu, go to the
Connections
tab - Search for
Hosted logs
and click on it. - In the
Configuration Details
tab under theConfigure promtail to send logs to your Grafana Cloud
section create a newAccess Policy token
- In the YAML section see the
url
under theclient
section - The URL consists of
https://{Number}:{Token}@{URL}
- The number is the
ENV0_LOKI_USERNAME
you will need to enter below in the environment variables section - for example:875656
- The token is the
ENV0_LOKI_PASSWORD
you will need to enter below in the environment variables section. - The URL should be the
ENV0_LOKI_HOST
- Make sure you only take the Host part, and make sure you add anhttps://
at the beginning. For example, a valid URL ishttps://logs-prod-006.grafana.net>
Self Installation of Grafana
- The URL should be the URL where
Loki
is deployed e.ghttp://localhost:3100
- The username and password of the Loki server if it requires basic authentication.
In the env0 platform you will need to configure the following environment variables in any scope you would like to have them:
Environment variable name | Description | Mandatory |
---|---|---|
ENV0_LOKI_HOST | The URL where Loki is located - Should start with http or https and should not contain the full URL, just the domain. For example: https://logs-prod-006.grafana.net | Yes |
ENV0_LOKI_USERNAME | The Username for authentication | No |
ENV0_LOKI_PASSWORD | The Password for authentication | No |
Labels
By default we are adding a label called
app
with a value ofenv0
Updated 7 months ago