当前位置:网站首页>Promtool Check
Promtool Check
2022-07-25 00:05:00 【InfoQ】
[[email protected] ~]# ./promtool --help
usage: promtool [<flags>] <command> [<args> ...]
Tooling for the Prometheus monitoring system.
Flags:
-h, --help Show context-sensitive help (also try --help-long and
--help-man).
--version Show application version.
--enable-feature= ... Comma separated feature names to enable (only PromQL
related). See
https://prometheus.io/docs/prometheus/latest/feature_flags/
for the options and more details.
Commands:
help [<command>...]
Show help.
check service-discovery [<flags>] <config-file> <job>
Perform service discovery for the given job name and report the results,
including relabeling.
check config [<flags>] <config-files>...
Check if the config files are valid or not.
check web-config <web-config-files>...
Check if the web config files are valid or not.
check rules [<flags>] <rule-files>...
Check if the rule files are valid or not.
check metrics
Pass Prometheus metrics over stdin to lint them for consistency and
correctness.
examples:
$ cat metrics.prom | promtool check metrics
$ curl -s http://localhost:9090/metrics | promtool check metrics
query instant [<flags>] <server> <expr>
Run instant query.
query range [<flags>] <server> <expr>
Run range query.
query series --match=MATCH [<flags>] <server>
Run series query.
query labels [<flags>] <server> <name>
Run labels query.
debug pprof <server>
Fetch profiling debug information.
debug metrics <server>
Fetch metrics debug information.
debug all <server>
Fetch all debug information.
test rules <test-rule-file>...
Unit tests for rules.
tsdb bench write [<flags>] [<file>]
Run a write performance benchmark.
tsdb analyze [<flags>] [<db path>] [<block id>]
Analyze churn, label pair cardinality and compaction efficiency.
tsdb list [<flags>] [<db path>]
List tsdb blocks.
tsdb dump [<flags>] [<db path>]
Dump samples from a TSDB.
tsdb create-blocks-from openmetrics <input file> [<output directory>]
Import samples from OpenMetrics input and produce TSDB blocks. Please refer to
the storage docs for more details.
tsdb create-blocks-from rules --start=START [<flags>] <rule-files>...
Create blocks of data for new recording rules.
[[email protected] ~]#
essential information
--help--help-long--version[[email protected] ~]# ./promtool --version
promtool, version 2.37.0 (branch: HEAD, revision: b41e0750abf5cc18d8233161560731de05199330)
build user: [email protected]
build date: 20220714-15:13:18
go version: go1.18.4
platform: linux/amd64
--enable-feature=Use Promtool Inspection
Check the service and find
./promtool check service-discovery [<flags>] <config-file> <job>
./promtool check service-discovery /erdong/prometheus-pushgateway/conf/prometheus.yml pushgateway-k8s
[
{
......
"discoveredLabels": {
"__address__": "172.31.91.38:9091",
"__meta_kubernetes_namespace": "appops",
"__meta_kubernetes_pod_annotation_cattle_io_timestamp": "2022-07-22T09:40:36Z",
"__meta_kubernetes_pod_annotation_cni_projectcalico_org_podIP": "172.31.91.38/32",
"__meta_kubernetes_pod_annotation_field_cattle_io_ports": "[[{\"containerPort\":9091,\"dnsName\":\"pushgateway-nodeport\",\"hostPort\":0,\"kind\":\"NodePort\",\"name\":\"pushgateway\",\"protocol\":\"TCP\",\"sourcePort\":9091}]]",
"__meta_kubernetes_pod_annotationpresent_cattle_io_timestamp": "true",
"__meta_kubernetes_pod_annotationpresent_cni_projectcalico_org_podIP": "true",
"__meta_kubernetes_pod_annotationpresent_field_cattle_io_ports": "true",
"__meta_kubernetes_pod_container_init": "false",
"__meta_kubernetes_pod_container_name": "pushgateway",
"__meta_kubernetes_pod_container_port_name": "pushgateway",
"__meta_kubernetes_pod_container_port_number": "9091",
"__meta_kubernetes_pod_container_port_protocol": "TCP",
"__meta_kubernetes_pod_controller_kind": "ReplicaSet",
"__meta_kubernetes_pod_controller_name": "pushgateway-6d695f75cf",
"__meta_kubernetes_pod_host_ip": "172.30.7.229",
"__meta_kubernetes_pod_ip": "172.31.91.38",
"__meta_kubernetes_pod_label_pod_template_hash": "6d695f75cf",
"__meta_kubernetes_pod_label_workload_user_cattle_io_workloadselector": "pushgateway",
"__meta_kubernetes_pod_labelpresent_pod_template_hash": "true",
"__meta_kubernetes_pod_labelpresent_workload_user_cattle_io_workloadselector": "true",
"__meta_kubernetes_pod_name": "pushgateway-flink-6d695f75cf-9jgdk",
"__meta_kubernetes_pod_node_name": "erdong-test-7-229",
"__meta_kubernetes_pod_phase": "Running",
"__meta_kubernetes_pod_ready": "true",
"__meta_kubernetes_pod_uid": "7b9662d8-1831-4440-9bc5-9523dbda0c12",
"__metrics_path__": "/metrics",
"__scheme__": "http",
"__scrape_interval__": "20s",
"__scrape_timeout__": "10s",
"job": "pushgateway-k8s"
},
......
"labels": {}
}
]
Check the configuration file
./promtool check config [<flags>] <config-files>...
./promtool check config /erdong/prometheus-pushgateway/conf/prometheus.yml
Checking /erdong/prometheus-pushgateway/conf/prometheus.yml
SUCCESS: /erdong/prometheus-pushgateway/conf/prometheus.yml is valid prometheus config file syntax
Check web-config
./promtool check web-config <web-config-files>...
Check the alarm rules and recording rules
./promtool check rules [<flags>] <rule-files>...
Inspection index
./promtool check metrics
Pass Prometheus metrics over stdin to lint them for consistency and
correctness.
examples:
$ cat metrics.prom | promtool check metrics
$ curl -s http://localhost:9090/metrics | promtool check metrics
边栏推荐
- Log4j configuration file
- 采坑记录:TypeError: 'module' object is not callable
- SQL result export function. If you click the work order but don't enter it, the interface is always blank and there is no response. What should you do?
- SQLite database operation
- Answers to some problems encountered in the process of Xperia XZ (f8332) brushing and root
- The new version of SSM video tutorial in shangsilicon valley was released
- Kubernetes application design guide
- Leetcode 0123. the best time to buy and sell stocks III: dynamic programming + simulation in constant space
- SQL file import database - Nanny level tutorial
- Why do I have to clean up data?
猜你喜欢

Pain and happiness -nio programming

Live broadcast preview | online seminar on open source security governance models and tools

Branch and loop statements in C language learning

Efficiency increased by 98%! AI weapon behind operation and maintenance inspection of high altitude photovoltaic power station

Video chat source code - one-to-one live broadcast system source code

UART

Pit record: typeerror:'module'object is not callable

Let me introduce you to the partition automatic management of data warehouse

Fast development board for Godson solid state drive startup (burning system to solid state) - partition

From the big guy baptism! 2022 headline first hand play MySQL advanced notes, and it is expected to penetrate P7
随机推荐
C语言学习之分支与循环语句
EF core: self referencing organizational structure tree
Vite3.0 has been released, can you still roll it (list of new features)
Are you still using system. Currenttimemillis()? Take a look at stopwatch
[LeetCode周赛复盘] 第 83 场双周赛20220723
Mandatory interview questions: 1. shallow copy and deep copy_ Deep copy
50 places are limited to open | with the news of oceanbase's annual press conference coming!
SQL result export function. If you click the work order but don't enter it, the interface is always blank and there is no response. What should you do?
Transmission download list, download file migration machine guide
.net redis client newlife.redis.core library usage
LeetCode_6124_第一个出现两次的字母
Routing policy in republishing
Only by learning these JMeter plug-ins can we design complex performance test scenarios
[untitled]
Can Baidu network disk yundetectservice.exe be disabled and closed
Bug summary
LeetCode_ 6124_ The first letter that appears twice
ES6 adds -iterator traversal, for..Of loop
Mandatory interview questions: 1. shallow copy and deep copy_ Shallow copy
2022 Henan Mengxin League game 2: Henan University of technology I - 22