Grafana Loki
Currently, this feature is behind the feature flag SRM_ENABLE_GRAFANA_LOKI_LOGS
. Contact Harness Support to enable the feature.
Before you begin
This page assumes you have followed the rest of the steps to set up CV. To learn more, go to Configure CV
Add Grafana Loki as a health source
To add a health source:
-
In the Health Sources section of the Verify screen, select + Add New Health Source.
The Add New Health Source dialog appears.
-
In the Define Health Source tab, do the following:
-
In the Define Health Source section, select GrafanaLoki as the health source type.
-
In the Health Source Name field, enter a name for the health source.
-
In the Connect Health Source section, select Select Connector.
The Create or Select an Existing Connector dialog appears.
-
Select a connector for the Grafana Loki health source, and then select Apply Selected.
The selected connector appears in the Select Connector dropdown. The Grafana Loki Logs option is selected by default in the Select Feature field.
-
Follow these steps to create a new Grafana Loki connector.
- Select Next. The Configuration tab appears.
Define log configuration settings
-
In the Configuration tab, select + Add Query.
The Add Query dialog appears.
-
Enter a name for the query and then select Submit.
The query that you added gets listed under Logs Group. The query specification and mapping settings are displayed. These settings help you retrieve the desired logs from the Grafana Loki platform and map them to the Harness service.
Define a query
-
In the Query field, enter a log query and select Run Query to execute it.
A sample record in the Records field. This helps you confirm the accuracy of the query you've constructed.
-
In the Field Mapping section, select + to map the service instance identifiers to select the data that you want to be displayed from the logs. For more information, go to Service Instance Identifier (SII).
-
Select Get sample log messages.
Sample logs are displayed that help you verify if the query is correct.