Grafana provides visualizations for the metrics collected from various exporters via Prometheus. Follow these steps to set up dashboards in Grafana for monitoring your infrastructure and applications effectively:
Open your browser and navigate to the Grafana URL (e.g., http://prodmon.merusphere.in/
).
Log in with your credentials.
From the left-hand menu, click Connections > Data Sources.
Click Add new data source.
Select Prometheus from the list of data sources.
Configure the data source:
http://172.21.0.45:9090
).Click Save & Test to verify the connection.
Go to Dashboards.
Create a project folder to organize dashboards by project:
Click New > Import to import a dashboard.
Enter the dashboard ID from Grafana.com or upload a JSON file.
Click Load.
Select the Prometheus data source you configured earlier.
Click Import to add the dashboard.
Click New > Dashboard in the left-hand menu.
Click Add Visualization to add panels.
Select the data source.
Configure the panel:
Click Apply to save the panel.
Add more panels as needed.
Click Save Dashboard and provide a name for your dashboard.
Below are some example dashboards that can be imported directly using their IDs:
Dashboard Name | ID |
---|---|
Prometheus All Metrics | 19268 |
Node Exporter Full | 1860 |
Redpanda Ops Dashboard | 18135 |
Redpanda Default Dashboard | 18134 |
HAProxy Full | 12693 |
NiFi Metrics | 6123 |
MySQL | 7362 |
Blackbox Exporter | 7587 |
Jenkins | 9964 |
Open a Panel
Navigate to the desired panel in your dashboard. Click on the three-dot menu (options) and select More > New Alert Rule.
Edit the Alert Name
Provide a meaningful name for the alert that reflects its purpose or monitored service.
Define the Query
Configure a query to fetch the numerical data required for evaluating the alert.
Define Alert Conditions
Set conditions based on the metrics and thresholds you want to monitor. For example, trigger an alert if Node status is less than 1.
Set Evaluation Behavior
Specify how the alert should be evaluated, including the evaluation interval and for how long the condition must persist before triggering an alert.
Configure Labels and Notifications
Add Labels: Create labels to classify the alert, such as severity and purpose.
Select Contact Points: Assign the contact point(s) where notifications should be sent (e.g., email, Slack).
Add Annotations
Include annotations to provide additional context or descriptions for the alert when it is triggered.
Save the Alert
Click “Save” to finalize the alert configuration.