Skip to main content
Version: dev

Monitoring:etcd monitoring

HertzBeat monitors the etcd key-value store by collecting metrics from the Prometheus metrics endpoint that etcd exposes.

etcd 3.4+ is supported (the database size metric etcd_mvcc_db_total_size_in_bytes replaced the old etcd_debugging_* name in 3.4).

PreRequisites

Make sure HertzBeat can reach etcd's metrics endpoint

etcd exposes Prometheus-format metrics on its client port (default 2379) at the /metrics path. Make sure this address is reachable from HertzBeat:

  1. If etcd only listens on localhost, or client mutual TLS is enabled on the client port, configure a dedicated metrics listener via --listen-metrics-urls. It serves the metrics and health-check endpoints; if exposed without TLS, restrict it to a trusted network.
  2. Access {metrics-host}:{metrics-port}/metrics (the client port 2379 by default) from the HertzBeat host to confirm metrics data can be fetched.

More information see etcd monitoring documentation.

Configuration parameter

Parameter nameParameter help description
Target HostMonitored IPV4, IPV6 or domain name. Note⚠️Without protocol header (eg: https://, http://)
PortPort of the etcd metrics endpoint, default 2379 when using the client listener
Query TimeoutHTTP request timeout in milliseconds, default 6000
HTTPSWhether to use HTTPS to request the metrics endpoint
HeadersOptional extra HTTP request headers
Auth TypeOptional Basic/Digest auth if the metrics endpoint sits behind an auth proxy
Username / PasswordCredentials used when Auth Type is set

Collection Metric

Metric set:etcd_server_has_leader

Metric nameMetric unitMetric help description
hasLeadernoneWhether this etcd member has a raft leader (1=yes, 0=no)

Metric set:etcd_mvcc_db_total_size_in_bytes

Metric nameMetric unitMetric help description
dbSizeMBTotal size of the underlying database physically allocated

Metric set:etcd_server_leader_changes_seen_total

Metric nameMetric unitMetric help description
leaderChangesnoneTotal number of leader changes observed

Metric set:process_cpu_seconds_total

Metric nameMetric unitMetric help description
cpuSecondssecondCumulative user and system CPU time consumed

Metric set:process_resident_memory_bytes

Metric nameMetric unitMetric help description
memoryMBResident memory size of the process