Skip to content

Metrics Collection


Guance metrics collection is implemented based on DataKit (data collector), and its workflow follows a standardized pipeline model.

Deploy DataKit

Install DataKit

Two installation methods are supported:

Configure Collectors

Metrics collection is achieved through DataKit's standardized configuration. The core process consists of four steps:

  1. Create a configuration template: Navigate to the target collector's configuration directory (e.g., /usr/local/datakit/conf.d/mysql/), copy the official .conf.sample template file to an effective configuration file with a .conf extension.
  2. Edit core parameters: Define basic connections (e.g., host for MySQL), collection strategies (e.g., interval for time intervals), and business tags in the configuration file.
  3. Restart to take effect: Execute datakit --restart to load the configuration. Verify the status using log keywords (e.g., mysql collector started) and the datakit monitor command.
  4. Extend for multiple scenarios such as infrastructure, middleware, and custom metrics.

For specific configuration steps, refer to Collector Configuration.

Custom Metrics Collection

In addition to collecting metric data through DataKit, you can also implement custom metrics collection for infrastructure, middleware, and business layers through multi-dimensional methods such as the Prometheus ecosystem, HTTP API push, Graphite/StatsD protocol reception, Telegraf/Kafka pipeline transmission, SQL query generation, and Python script extensions.





Tag Specifications

  • Prohibit dynamic tags (e.g., user_id, ip), use only static business tags (e.g., env, project).

  • Global tags (datakit.conf):

[global_tags]
cluster = "k8s-01"
region = "cn-east"

Data Validation

Feedback

Is this page helpful? ×