Skip to main content

Introduction

Monitoring your AutoMQ cluster helps you detect issues early and optimize performance. This guide shows how to integrate Prometheus [2] and VictoriaMetrics [3] to collect, store, and query AutoMQ metrics.

AutoMQ Overview

AutoMQ is a Kafka-compatible streaming platform [1]. See Overview for details.

Prometheus Overview

Prometheus is an open-source system monitoring and alerting toolkit initially developed by SoundCloud and released as open source in 2012. It offers robust data collection, storage, and querying capabilities, enabling real-time monitoring of system and application performance metrics. Prometheus utilizes a multidimensional data model that uses labels to tag and query monitoring data, and it supports the flexible query language PromQL. The primary advantages of Prometheus include efficient data collection, strong query functionality, and a rich alerting mechanism, making it widely used in the cloud-native ecosystem. However, Prometheus has certain limitations in large-scale data storage, particularly when it comes to long-term storage and high-concurrency querying. Its storage performance and query efficiency may be affected. Consequently, integrating an efficient storage backend becomes essential to address these challenges.

VictoriaMetrics Overview

VictoriaMetrics is a high-performance, open-source time-series database designed for high-concurrency data writing and querying. It features efficient data compression and storage capabilities, offering high throughput for data writes and queries with minimal hardware resource consumption. VictoriaMetrics supports Prometheus’ remote storage interface, allowing seamless integration into existing Prometheus monitoring systems. Below is an architecture diagram of VictoriaMetrics: VictoriaMetrics Structure [4] By utilizing VictoriaMetrics as the storage backend for Prometheus, organizations can significantly improve the storage and query performance of their monitoring systems, fulfilling the requirements for large-scale data storage and high-concurrency queries. The primary advantages of VictoriaMetrics include efficient data compression, rapid data querying, and low resource consumption, making it an excellent option as a storage backend for Prometheus. Below, I will proceed with the deployment of AutoMQ, Prometheus, and VictoriaMetrics.

Prerequisites

  • Deploy a functional AutoMQ node/cluster and open the Metrics collection port
  • Deploy VictoriaMetrics as the storage backend for Prometheus
  • Deploy Prometheus to retrieve Metrics data

Deploying AutoMQ, VictoriaMetrics, Prometheus

Deploying AutoMQ

Refer to the AutoMQ documentation: Deploy Multi-Nodes Cluster on Linux▸. Before starting deployment, add the following configuration parameters to enable Prometheus’s pull interface. Once the AutoMQ cluster is launched with these parameters, each node will additionally open an HTTP interface for retrieving AutoMQ monitoring metrics. These metrics comply with the Prometheus Metrics format.
With AutoMQ monitoring metrics enabled, you can access Prometheus format monitoring metrics from any node via HTTP at the address: http://{node_ip}:8890, with the response example as follows:
For a detailed introduction to the metrics, refer to the AutoMQ official documentation: Prometheus Metrics▸.

Deploying VictoriaMetrics

Reference documentation: VictoriaMetrics [7]. VictoriaMetrics supports deployments via binary versions, Docker images, and source code. Here, we choose to deploy via Docker. Execute the following command to start the VictoriaMetrics container and map the data files to the folder /home/VictoriaMetrics/data for easy monitoring of data import changes:
Verify a successful installation by accessing: http://{client_ip}:8428 in a browser.

Deploying Prometheus

Prometheus can be deployed by downloading the binary package or using Docker. Below is an introduction to both deployment methods.

Binary Deployment

For ease of use, you can create a new script and modify the Prometheus download version as needed. After creating the script, execute it to complete the deployment. First, create a new script:
The content of the script is as follows:
Next, modify Prometheus’s configuration file, add the task to collect AutoMQ observable data, and restart Prometheus. Execute the command:
The configuration file reference is as follows: Please change the client_ip to the address exposed by AutoMQ for observable data.
After deployment, you can access Prometheus via a browser to verify if the Metrics data from AutoMQ has been successfully collected. Visit http://{client_ip}:9090/targets.

Docker Deployment

If you have a running Prometheus Docker container, execute the command to remove the container first:
Create a new configuration file and attach it when launching Docker:
Launch the Docker container:
This sets up a Prometheus service to collect AutoMQ Metrics. For further details on integrating AutoMQ Metrics with Prometheus, please visit: Integrating Metrics into Prometheus | AutoMQ [8].

Check the Integration Results.

VictoriaMetrics Data Verification

VictoriaMetrics offers a Dashboard accessible via http://{client_ip}:8428/vmui, where the initial display is: Data file verification. Existing data files are identified in the data directory: Data file verification. Existing data files are identified in the data directory:
By accessing the status at http://{client_ip}:8428/api/v1/status/tsdb, you can obtain a JSON file:

Grafana Dashboard (Optional)

Since we have used VictoriaMetrics as Prometheus storage, we can configure it as a data source for Grafana at http://{client_ip}:8428, to access the status information of the AutoMQ cluster. For Grafana template files, you can refer to the official AutoMQ templates: grafana [9]. The final demonstration output is as follows: Cluster Overview: Provides cluster-level monitoring information, including metrics like the number of nodes, data size, and cluster traffic. Additionally, it offers an overview of dimensions such as Topic, Group, and Broker, with support for drill-down functionality to examine detailed monitoring information. With this, our integration process concludes; more features to explore can be referenced at VictoriaMetrics With this, our integration process concludes; further features to explore can be found in the VictoriaMetrics official documentation [10].

Summary

In this article, we have thoroughly examined how to integrate AutoMQ, Prometheus, and VictoriaMetrics to enable comprehensive monitoring of AutoMQ clusters. We began by introducing the functions and advantages of each component, explaining why Prometheus was chosen as the monitoring system and why VictoriaMetrics is essential as the storage backend for Prometheus. Next, we offered step-by-step guidance on deploying and configuring AutoMQ, VictoriaMetrics, and Prometheus, and confirmed the effectiveness of this integration. With this integration approach, enterprises can gain the following benefits:
  1. Efficient data collection and storage: Prometheus handles efficient data collection, while VictoriaMetrics provides efficient data storage and compression capabilities, ensuring that the system can store large-scale time-series data with minimal hardware resource consumption.
  2. Fast data querying: VictoriaMetrics offers rapid data query performance to meet high concurrent query demands, ensuring efficient queries in scenarios involving large-scale data storage.
  3. Prometheus Integration: VictoriaMetrics supports Prometheus’ remote storage interface, enabling smooth integration with existing Prometheus monitoring systems and enhancing the overall performance and stability of such systems.
Through this integration, enterprises can achieve comprehensive monitoring of AutoMQ clusters, ensuring high availability and performance optimization, promptly detecting and addressing potential issues, optimizing system performance, and ensuring business continuity and stability. Looking ahead, as business demands evolve and technology advances, we can further explore and refine monitoring solutions to address more complex application scenarios and higher performance requirements efficiently.

References

[1] AutoMQ: https://www.automq.com/zh [2] Prometheus: https://prometheus.io/docs/prometheus/latest/getting_started/ [3] VictoriaMetrics: https://docs.victoriametrics.com/ [4] VictoriaMetrics Structure: https://docs.victoriametrics.com/cluster-victoriametrics/ [5] Cluster Deployment | AutoMQ: https://docs.automq.com/automq/getting-started/deploy-multi-nodes-test-cluster-on-docker [6] Metrics | AutoMQ: https://docs.automq.com/automq/observability/overview [7] VictoriaMetrics Installation Documentation: https://docs.victoriametrics.com/ [8] Integrating Metrics with Prometheus: https://docs.automq.com/automq/observability/overview [9] grafana: https://github.com/AutoMQ/automq/tree/main/docker/telemetry/grafana/provisioning/dashboards [10] VictoriaMetrics Official Documentation: https://docs.victoriametrics.com/