Advanced metrics with Promethe...
Install and configure Grafana
10 min
the following steps describe configuring a prometheus connection in grafana so you can create dashboards and panels that use this data source install grafana to install grafana in either linux, macos, or windows, follow the instructions on the grafana website ( grafana com/docs/grafana/latest/ ) access the grafana user interface perform the following steps to access the grafana user interface (ui) go to the grafana ui by browsing to its ip address or domain name for example, if grafana is running on your local machine, the url is http //localhost 3000 log in with your admin account add and configure a new data source perform the following steps to add and configure the new data source in the left menu, go to configuration > data sources select \[ add new data source ] select prometheus as the data source type provide the following details for the prometheus data source name enter a name for the data source (such as prometheus ) url enter the url of your prometheus server (such as http //localhost 9090 ) auth select an authentication option based on your prometheus server configuration basic auth enable or disable based on your prometheus server configuration if your prometheus server uses tls (https), you might need to configure the tls auth settings here, you must specify the certificate, client certificate, client key, and ca certificates for your prometheus instance iif you're unsure about these settings, see the prometheus documentation ( prometheus io/docs/introduction/first steps/ ) other settings you can configure include alterting , type and version , misc , and exemplars for help, see the grafana documentation ( grafana com/docs/grafana/latest/?utm source=grafana gettingstarted ) select \[ save & test ] at the bottom of the page when finished create a new dashboard and add a panel to visualize metrics a grafana dashboard, a customizable container for panels, is organized and laid out in a grid like structure it enables you to visualize, analyze, and track metrics and logs from various data sources in real time dashboards can be interactive, and they serve as a central space for monitoring key data points, displaying performance metrics, identifying trends, and exploring potential issues a panel, a basic visual element in grafana, can hold a graph, single stat, table, map, or other types of data visualization perform the following tasks to create a new dashboard and panel for visualizing metrics pulled from prometheus create a new dashboard to create a dashboard, in the left menu, go to dashboards > new dashboard the creates a new dashboard with an empty panel add a panel on your new dashboard, a text box prompts you to create a new panel or row select \[ add a new panel ] this opens the panel editor configure the panel perform the following steps to configure the panel on the queries tab, you can configure the panel data source and set up queries select the drop down menu next to data source and select the your prometheus data source from the list after selecting your prometheus data source, you can create your query in the metric drop down list, select the metric you want to visualize in this panel optionally, you can configure label filters as well now, select \[ run queries ] to run the query you configured and see the results visualized in the graph on the panel customize the panel after setting up your queries, you can move on to visualizing the data perform the following steps to customize the panel go to the visualization tab next to queries here, you can select the type of visualization (graph, gauge, table, and so on) and customize it as needed next, select the general tab where you can name your panel and add a description after you have configured your panel, select \[ apply ] in the upper right corner save the dashboard perform the following steps to save the configured dashboard select the disk icon in the upper right corner the save dashboard dialog displays, prompting for the dashboard name and description enter these details and select \[ save ] sample dashboard the following image shows an example dashboard with two panels added to visual latency metrics sample dashboard with two panels