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.
Prerequisites
Section titled “Prerequisites”- You have a STACKIT Logs Instance: Create your first STACKIT Logs instance
- You have credentials with read permission for the STACKIT Logs Instance: Retrieve credentials for STACKIT Logs instance
- Data source URL of the STACKI Logs Instance: Retrieve API URL STACKIT Logs instance
- You have a Grafana instance running: e.g. Grafana instance with Docker
Configure Loki DataSource in Grafana with authentication
Section titled “Configure Loki DataSource in Grafana with authentication”- Visit the Grafana server with Admin access.
- On the sidebar click on Connections.
- Then under Connections, click Data sources.
- Click Add new data source.
- Select Loki from the list to create a new source.
- Set the name of the source.
- Under Connection, set the URL value taken from “Data source URL” of Logs instance in STACKIT Portal.
- Scroll down and look for HTTP Headers section, click on it.
- Click Add header, it will show two text fields.
- In Header field write Authorization.
- In Value field for Authorization header, put the value as
Bearer [token-value-from-logs-instance-access-token]. For exampleBearer eyJhbGc.... - 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