Categraf Documentation

repository·main·Indexed 23 days ago

https://github.com/flashcatcloud/categraf

An all-in-one telemetry collector supporting both metrics and logs collection, designed to work with Nightingale across cloud-native and hybrid cloud architectures. It includes various input plugins for monitoring services such as ActiveMQ, Alibaba Cloud (Aliyun), AMD ROCm SMI, Apache, AppDynamics, ARP packets, BIND 9, Bitbucket, and cAdvisor.

Tokens
161.1K
Snippets
221
Records
565
Agent score
78%

What's inside categraf

  1. Overview of Categraf features

    main

    Categraf is an All-in-One telemetry collector designed for metrics and log collection across physical machines, VMs, switches, containers, K8s, and various middleware/databases.

    Key Features:

    • Plugin Support: Built-in support for nearly 100 collection plugins.
    • Push Model: Uses a PUSH mechanism to send data, which is ideal for environments with strict network policies.
    • Remote Write Protocol: Supports pushing data to backends like Nightingale, Prometheus, and VictoriaMetrics.
    • High Cardinality Management: Performs processing at the collection side to mitigate high cardinality issues in time-series databases.
  2. Overview of the Netstat input plugin

    main

    The netstat input plugin monitors network connection states. It is primarily used to collect the distribution of various TCP and UDP connection states within the operating system, such as the count of connections in TIME_WAIT, ESTABLISHED, or CLOSE_WAIT states.

    Supported Platforms:

    • Windows
    • Linux
    • macOS
    • BSD
  3. Overview of the snmp_zabbix plugin

    main

    The snmp_zabbix plugin is an SNMP data collection plugin compatible with Zabbix collection templates. Its primary advantage is the ability to directly use Zabbix YAML format template files, allowing users to leverage the Zabbix template ecosystem without rewriting monitoring configurations.

    Key Features:

    • Full SNMP Support: Supports SNMPv1, v2c, and v3.
    • Zabbix Template Compatibility: Directly uses Zabbix 6.0+ YAML format templates.
    • Automatic Discovery: Supports LLD (Low-Level Discovery) to automatically discover network interfaces, file systems, and other resources.
    • Advanced Preprocessing: Supports over 20 preprocessing methods, including regular expressions, JavaScript, and numerical calculations.
    • Fine-grained Scheduling: Supports item-level scheduling for collection tasks.
    • Health Checks: Automatically detects connection status and performs reconnections.
  4. Use the Jolokia Proxy Input Plugin to collect JMX metrics

    main

    The Jolokia Proxy input plugin allows Categraf to collect JMX metrics from multiple target Java applications through a single, centralized Jolokia Proxy service. This is useful when deploying individual Jolokia Agents or opening network ports on every instance is not feasible. Categraf sends requests to the Proxy, which then forwards them to the specified target JMX endpoints.

    [[instances]]
    url = "http://localhost:8080/jolokia"
    
    [[instances.target]]
    url = "service:jmx:rmi:///jndi/rmi://target-host-1:9010/jmxrmi"
    
    [[instances.metric]]
    name  = "java_memory"
    mbean = "java.lang:type=Memory"
  5. Use the Node Exporter plugin for *nix system metrics

    main

    The node_exporter plugin integrates the core logic of the official Prometheus node_exporter to collect comprehensive hardware and operating system metrics for *nix systems (Linux, macOS, BSD, etc.).

    Key Benefits:

    • Provides a metric set 100% compatible with the official node_exporter.
    • Allows direct reuse of community Grafana dashboards and alerting rules designed for Prometheus.

    Important Usage Note: Enabling this plugin may cause metric overlap with Categraf's built-in cpu, mem, and disk plugins. It is recommended to choose one approach per machine: either use Categraf's native basic plugins OR use only this node_exporter plugin.

  6. Identify the correct Jolokia plugin for your use case

    main

    The inputs/jolokia directory contains shared library code and collector logic for the Jolokia protocol, but it is not a standalone Categraf plugin. To collect metrics via Jolokia, you must use one of the following specific plugins depending on your architecture:

    1. jolokia_agent: Use this if you are connecting directly to a Jolokia Agent deployed inside individual Java applications (Recommended).
    2. jolokia_proxy: Use this if you are collecting metrics from multiple Java applications through a centralized Jolokia Proxy.

    Please refer to the documentation for those specific plugins to configure and run them.

  7. Use the Processes input plugin to monitor process state distribution

    main

    The processes input plugin collects statistics on the distribution of operating system process counts, such as the number of processes in Running, Sleeping, or Zombie states.

    Supported Platforms: Linux, FreeBSD, OpenBSD, and macOS.

    Note: This plugin is not supported on Windows; the related logic will not function on Windows systems.

  8. Monitor Linux conntrack table status with the Conntrack plugin

    main
    The Conntrack plugin monitors the state of the connection tracking (conntrack) table on Linux servers. It is specifically designed to help prevent the nf_conntrack: table full, dropping packet error by providing real-time visibility into conntrack table utilization. This plugin is a fork of telegraf/conntrack.
  9. Use the Self Metrics plugin to monitor Categraf

    main

    The self_metrics plugin collects Categraf's internal operational metrics. It monitors Go runtime statistics (e.g., Goroutines, GC, memory allocation) and Categraf-specific metrics like the status of the metric push queue.

    This plugin is essential for monitoring the health of the Categraf agent itself, specifically to detect memory leaks or queue congestion (where the collection rate exceeds the transmission rate).

  10. Use the Prometheus input plugin

    main

    The Prometheus plugin is a general-purpose scraper for HTTP /metrics endpoints that expose data in the Prometheus format. It is designed to collect metrics from cloud-native components and business applications that have built-in Prometheus SDKs.

    Note: Due to naming conflicts and functional evolution, some features of this plugin may also be handled by the openmetrics plugin; their configuration logic is largely interchangeable.