Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to quickly build a Monitoring platform with Grafana + Prometheus

2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you Grafana + Prometheus how to quickly build a monitoring platform, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's learn about it!

Overall visualization scheme

Grafana: by querying the collected data and displaying it visually

Prometheus: stores time series data, that is, a collection of consecutive data stored in a time dimension in the same time sequence (same name and label)

Exporter: it is an important part of prometheus monitoring and is responsible for the collection of data indicators.

Grafana introduction

Grafana is an open source suite of metrics analysis and visualization. It is often used as the visualization of infrastructure time series data and application analysis.

Grafana supports many different data sources. Each data source has a specific query editor whose customized features and functions are exposed specific data sources.

Prometheus introduction

Prometheus is an open source system monitoring and alarm framework, it can be understood that Prometheus is a database, it needs to be used with Exporter. Exporter is the program responsible for data reporting, and different Exporter is responsible for different business. Its unified naming format: xx_exporter.

The official exporter provided by Prometheus includes blackbox_exporter, consul_exporter, graphite_exporter, haproxy_exporter, memcached_exporter, mysqld_exporter, node_exporter, statsd_exporter, and many third-party exporter, such as Redis exporter, RabbitMQ exporter, etc.

Prometheus only collects monitoring information in a specified format. It periodically calls the metrics data interface provided by exporter to obtain data, while exporter collects monitoring information from various software according to the format specified by Prometheus.

Case: using JMX to monitor the effect of Java program

Building process

This article uses the Windows system to install grafana and Prometheus, directly download and double-click.

Grafana default address: http://127.0.0.1:3000, default account number and password are admin

Prometheus default address: http://127.0.0.1:9090

Jmx_exporter

Monitoring Java programs can use jmx_exporter,github address: https://github.com/prometheus/jmx_exporter

Java-javaagent:./jmx_prometheus_javaagent-0.14.0.jar=8081:config.yaml-jar yourJar.jar

For config.yaml content, please refer to the example_configs directory in the jmx_exporter project.

Prometheus configuration

Modify prometheus.yml to configure the address of the exporter to be pulled

If you see the exporter you added in targets, you can collect the data.

Grafana Settin

Add data source

Check prometheus

Configure addr

Generate dashboard using the Grafana plug-in

Grafana provides many dashboard templates, such as downloading a template from https://grafana.com/dashboards/8563 and importing it into grafana to achieve jvm monitoring.

You can also create a dashboard manually

Create a monitoring panel

Create a monitoring indicator chart

Add indicator

Just save it.

Alarm function

Do you feel it is very convenient to realize the visualization of monitoring? at the same time, prometheus also provides an alarm plug-in alertmanager, which can realize the alarm function of abnormal monitoring through alertmanager.

These are all the contents of the article "how to quickly build a monitoring platform for Grafana + Prometheus". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report