当前位置:网站首页>Prometheus operation and maintenance tool promtool (III) debug function
Prometheus operation and maintenance tool promtool (III) debug function
2022-07-27 02:35:00 【InfoQ】
obtain profiling debug Information
promtool debug pprof <server>
[[email protected] ~]# ./promtool debug pprof 'http://127.0.0.1:9090'
collecting: http://127.0.0.1:9090/debug/pprof/threadcreate
collecting: http://127.0.0.1:9090/debug/pprof/profile?seconds=30
collecting: http://127.0.0.1:9090/debug/pprof/block
collecting: http://127.0.0.1:9090/debug/pprof/goroutine
collecting: http://127.0.0.1:9090/debug/pprof/heap
collecting: http://127.0.0.1:9090/debug/pprof/mutex
collecting: http://127.0.0.1:9090/debug/pprof/trace?seconds=30
Compiling debug information complete, all files written in "debug.tar.gz".
[[email protected] ~]# tar -zxf debug.tar.gz
[[email protected] ~]# ll -h
-rw-rw-rw- 1 root root 177 1 month 1 1970 block.pb
-rw-rw-rw- 1 root root 5.9K 1 month 1 1970 cpu.pb
-rw-rw-rw- 1 root root 7.4K 1 month 1 1970 goroutine.pb
-rw-rw-rw- 1 root root 223K 1 month 1 1970 heap.pb
-rw-rw-rw- 1 root root 177 1 month 1 1970 mutex.pb
-rw-rw-rw- 1 root root 493 1 month 1 1970 threadcreate.pb
-rw-rw-rw- 1 root root 73K 1 month 1 1970 trace.pb
obtain metric debug Information
promtool debug metrics <server>
[[email protected] ~]# ./promtool debug metrics 'http://127.0.0.1:9090'
collecting: http://127.0.0.1:9090/metrics
Compiling debug information complete, all files written in "debug.tar.gz".
[[email protected] ~]# tar -zxf debug.tar.gz
tar: metrics.txt: Untrusted old timestamp 1970-01-01 08:00:00
[[email protected] ~]# tail metrics.txt
# TYPE prometheus_web_federation_warnings_total counter
prometheus_web_federation_warnings_total 0
# HELP promhttp_metric_handler_requests_in_flight Current number of scrapes being served.
# TYPE promhttp_metric_handler_requests_in_flight gauge
promhttp_metric_handler_requests_in_flight 1
# HELP promhttp_metric_handler_requests_total Total number of scrapes by HTTP status code.
# TYPE promhttp_metric_handler_requests_total counter
promhttp_metric_handler_requests_total{code="200"} 519347
promhttp_metric_handler_requests_total{code="500"} 0
promhttp_metric_handler_requests_total{code="503"} 0
curl 127.0.0.1:9090/metrics > metrics.txt
Get all debug Information
promtool debug all <server>
[[email protected] ~]# ./promtool debug all 'http://127.0.0.1:9090'
collecting: http://127.0.0.1:9090/debug/pprof/profile?seconds=30
collecting: http://127.0.0.1:9090/debug/pprof/block
collecting: http://127.0.0.1:9090/debug/pprof/goroutine
collecting: http://127.0.0.1:9090/debug/pprof/heap
collecting: http://127.0.0.1:9090/debug/pprof/mutex
collecting: http://127.0.0.1:9090/debug/pprof/threadcreate
collecting: http://127.0.0.1:9090/debug/pprof/trace?seconds=30
collecting: http://127.0.0.1:9090/metrics
Compiling debug information complete, all files written in "debug.tar.gz".
[[email protected] ~]# tar -zxf debug.tar.gz
tar: cpu.pb: Untrusted old timestamp 1970-01-01 08:00:00
tar: block.pb: Untrusted old timestamp 1970-01-01 08:00:00
tar: goroutine.pb: Untrusted old timestamp 1970-01-01 08:00:00
tar: heap.pb: Untrusted old timestamp 1970-01-01 08:00:00
tar: mutex.pb: Untrusted old timestamp 1970-01-01 08:00:00
tar: threadcreate.pb: Untrusted old timestamp 1970-01-01 08:00:00
tar: trace.pb: Untrusted old timestamp 1970-01-01 08:00:00
tar: metrics.txt: Untrusted old timestamp 1970-01-01 08:00:00
[[email protected] ~]# ls
block.pb debug.tar.gz heap.pb mutex.pb trace.pb
cpu.pb goroutine.pb metrics.txt threadcreate.pb
Test rule file
promtool test rules <test-rule-file>...
[[email protected] ~]# ./promtool test rules promtsdb.rules.yaml
Unit Testing: promtsdb.rules.yaml
FAILED:
yaml: unmarshal errors:
line 1: field groups not found in type main.unitTestFile
summary
边栏推荐
猜你喜欢

HCIP-第一天

NAT网络地址转化实验

Redis安装及运行(linux)

How does the whole network display IP ownership?

在有序数组找具体某个数字

HCIP oSPF综合实验

How many holes have you stepped on in BigDecimal?

C language - assignment operator, compound assignment operator, self increasing and self decreasing operator, comma operator, conditional operator, goto statement, comment

NAT网络地址转换协议-拓扑实验

Hcip OSPF interface network interface type experiment
随机推荐
Open the door of programming
Use of golang - sync package (waitgroup, once, mutex, rwmutex, cond, pool, map)
Plato Farm有望通过Elephant Swap,进一步向外拓展生态
测试工作十年,想对还在迷茫的朋友说:一点要做好个人规划...
Hcip day 5 OSPF extended configuration experiment
从初级程序员到架构师学习路线+配套学习资源完整版
Find a specific number in an ordered array
JVM interview questions (necessary for interview)
Hcip the next day
HCIP第一天
How to judge whether a number is odd or even?
Witness that the "decoding 2022 strong star of China's network security" is about to set sail
Redis安装及运行(linux)
Make static routing accessible to the whole network through ENSP
Static routing experiment configuration
The pointer is really profound!!!
从单表到分表实现数据平滑迁移
【洋哥带你玩转线性表(一)——顺序表】
Hcip day 1
【C语言】strlen与sizeof相关区分