Zum Inhalt springen

Grafana: Use Logs instance as data source

Zuletzt aktualisiert am

To connect Grafana to STACKIT Logs instance, you need to create a new Loki data source connection in Grafana server. This guide shows the steps to perform for making 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 new 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, it will show 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 will be created successfully. You can now use this data source to view the logs in Grafana Explore section