当前位置:网站首页>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第一天静态路由综合实验
- HCIP-第五天-OSPF扩展配置实验
- C language - value range of data type and basic data type
- Hcip bidirectional republication and routing strategy
- Golang implements TCP chat room
- hcip--ospf接口网络接口类型实验
- Go language slow start -- go operator
- OSPF routing information protocol topology experiment
- Risc-v tool chain compilation notes
- JMeter下载安装
猜你喜欢

静态路由基本配置 实现全网可达

HCIP-第六天-OSPF静态大实验

MGRE, PPP, HDLC comprehensive experiment

C language -- while statement, dowhile statement, for loop and loop structure, break statement and continue statement

静态路由综合实验

OSPF summary (mind map)

Rip routing information protocol topology experiment

Solve prime numbers between 100 and 200

Risc-v tool chain compilation notes

JMeter下载安装
随机推荐
使用注解方式实现 Redis 分布式锁
TCP三次握手、四次断开
Hcip first day static routing comprehensive experiment
MGRE、PPP、HDLC综合实验
Open the door of programming
OSPF路由信息协议-拓扑实验
多点双向重发布和路由策略-拓扑实验
The pointer is really profound!!!
f8抓交通、f9抓兔子、f10turtle
NAT network address conversion experiment
[brother Yang takes you to play with the linear table (III) - two way linked list]
通过ensp让静态路由实现全网可达
证券公司哪家手续费最低?手机上开户安全吗
Go language slow start - package
Go language slow start -- go operator
Use of golang - sync package (waitgroup, once, mutex, rwmutex, cond, pool, map)
NPM reports an error, error: eperm: operation not permitted, MKDIR
C language - value range of data type and basic data type
[after this article, learning the linked list is a smooth way]
PPOCRLabel格式的数据集操作总结。