# HELP harbor_exporter_collector_duration_seconds Collector time duration. # TYPE harbor_exporter_collector_duration_seconds gauge harbor_exporter_collector_duration_seconds{collector="logs"} 0.04826962 harbor_exporter_collector_duration_seconds{collector="projects"} 0.174844256 harbor_exporter_collector_duration_seconds{collector="reach"} 0.011827241 harbor_exporter_collector_duration_seconds{collector="statistics"} 0.056164916 harbor_exporter_collector_duration_seconds{collector="systeminfo"} 0.032053573 harbor_exporter_collector_duration_seconds{collector="systeminfoVolumes"} 0.030168302 # HELP harbor_exporter_last_scrape_error Whether the last scrape of metrics from harbor resulted in an error (1 for error, 0 for success). # TYPE harbor_exporter_last_scrape_error gauge harbor_exporter_last_scrape_error 0 # HELP harbor_exporter_scrapes_total Total number of times harbor was scraped for metrics. # TYPE harbor_exporter_scrapes_total counter harbor_exporter_scrapes_total 697
单独一个指标在web上的格式为:
1 2 3 4 5
# HELP <metric name> <help_msg> # TYPE <metric name> <metrics type> <metric name>{<label1>=value1,label2=value2} <metrics value1> <metric name>{<label1>=value3,label2=value4} <metrics value2> ...
# HELP node_cpu_seconds_total Seconds the cpus spent in each mode. # TYPE node_cpu_seconds_total counter node_cpu_seconds_total{cpu="0",mode="idle"} 380090.49 node_cpu_seconds_total{cpu="0",mode="iowait"} 114.2 node_cpu_seconds_total{cpu="0",mode="irq"} 0 node_cpu_seconds_total{cpu="0",mode="nice"} 0.05 ...
# HELP node_filesystem_avail_bytes Filesystem space available to non-root users in bytes. # TYPE node_filesystem_avail_bytes gauge node_filesystem_avail_bytes{device="/dev/mapper/centos-home",fstype="xfs",mountpoint="/home"} 1.300291584e+10 node_filesystem_avail_bytes{device="/dev/mapper/centos-root",fstype="xfs",mountpoint="/"} 1.300291584e+10 node_filesystem_avail_bytes{device="rootfs",fstype="rootfs",mountpoint="/"} 1.300291584e+10
Gauge是最简单的度量类型,只有一个简单的返回值,可增可减,也可以 set 为指定的值,例如是否down了,可以在1和0之间set。
# HELP rest_client_request_latency_seconds Request latency in seconds. Broken down by verb and URL. # TYPE rest_client_request_latency_seconds histogram rest_client_request_latency_seconds_bucket{path="/",method="GET",code="200",le="0.1"} 1.0 rest_client_request_latency_seconds_bucket{path="/",method="GET",code="200",le="0.2"} 2.0 rest_client_request_latency_seconds_bucket{path="/",method="GET",code="200",le="0.3"} 2.0 rest_client_request_latency_seconds_bucket{path="/",method="GET",code="200",le="+Inf"} 2.0 rest_client_request_latency_seconds_sum{path="/",method="GET",code="200"} 0.150 rest_client_request_latency_seconds_count{path="/",method="GET",code="200"} 2.0
4、Summary:数据分布统计图
1 2 3 4 5 6 7 8 9
# HELP go_gc_duration_seconds A summary of the pause duration of garbage collection cycles. # TYPE go_gc_duration_seconds summary go_gc_duration_seconds{quantile="0"} 1.4846e-05 go_gc_duration_seconds{quantile="0.25"} 1.8948e-05 go_gc_duration_seconds{quantile="0.5"} 3.9602e-05 go_gc_duration_seconds{quantile="0.75"} 5.8061e-05 go_gc_duration_seconds{quantile="1"} 9.6987e-05 go_gc_duration_seconds_sum 0.000772525 go_gc_duration_seconds_count 18