Skip to content

Grafana: Read log data from STACKIT Logs

Last updated on

Log data stored in a STACKIT Logs instance can be read, queried, and visualized using Grafana. To connect Grafana to your STACKIT Logs instance, you need to configure a Loki data source connection in your Grafana server. This guide walks you through the steps to set up the connection.

Configure Loki DataSource in Grafana with authentication

Section titled “Configure Loki DataSource in Grafana with authentication”
  1. Visit the Grafana server with Admin access.
  2. On the sidebar click on Connections.
  3. Then under Connections, click Data sources.
  4. Click Add new data source.
  5. Select Loki from the list to create a data source.
  6. Set the name of the source.
  7. Under Connection, set the URL value taken from “Data source URL” of Logs instance in STACKIT Portal.
  8. Scroll down and look for HTTP Headers section, click on it.
  9. Click Add header, which shows two text fields.
  10. In Header field write Authorization.
  11. In Value field for Authorization header, put the value as Bearer [token-value-from-logs-instance-access-token]. For example Bearer eyJhbGc....
  12. Scroll down and click Save & Test.

If everything is configured correctly in the data source, the data source is created successfully. You can now use this data source to view the logs in Grafana Explore section