Grafana Loki

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:

  1. The Host URL
  2. Authorization username and password

Grafana Cloud

If you're using Grafana Cloud follow these steps to get the relevant data:

  1. On the left side menu, go to the Connections tab
  2. Search for Hosted logs and click on it.
  3. In the Configuration Details tab under the Configure promtail to send logs to your Grafana Cloud section create a new Access Policy token
  4. In the YAML section see the url under the client section
  5. The URL consists of https://{Number}:{Token}@{URL}
  6. The number is the ENV0_LOKI_USERNAME you will need to enter below in the environment variables section - for example: 875656
  7. The token is the ENV0_LOKI_PASSWORD you will need to enter below in the environment variables section.
  8. The URL should be the ENV0_LOKI_HOST - Make sure you only take the Host part, and make sure you add an https:// at the beginning. For example, a valid URL is https://logs-prod-006.grafana.net>

Self Installation of Grafana

  1. The URL should be the URL where Loki is deployed e.g http://localhost:3100
  2. 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 nameDescriptionMandatory
ENV0_LOKI_HOSTThe URL where Loki is located - Should start with httpor httpsand should not contain the full URL, just the domain. For example: https://logs-prod-006.grafana.netYes
ENV0_LOKI_USERNAMEThe Username for authenticationNo
ENV0_LOKI_PASSWORDThe Password for authenticationNo

📘

Labels

By default we are adding a label called app with a value of env0