当前位置:网站首页>Promtool Check
Promtool Check
2022-07-25 00:02: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] ~]#
基本信息
--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=使用 Promtool 进行检查
检查服务发现
./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": {}
}
]
检查配置文件
./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
检查 web-config
./promtool check web-config <web-config-files>...
检查告警规则和记录规则
./promtool check rules [<flags>] <rule-files>...
检查指标
./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
边栏推荐
- Notes of Teacher Li Hongyi's 2020 in-depth learning series 5
- Go basic notes_ 4_ map
- Notes of Teacher Li Hongyi's 2020 in-depth learning series 9
- Redis6.2 SYSTEMd startup prompt redis service: Failed with result ‘protocol‘.
- Unity+photon self made multiplayer TPS game
- Transmission download list, download file migration machine guide
- The use of where condition in MySQL is not equal to! = The problem that null values are filtered out occurs when in, etc
- 技术操作
- JS ------ Chapter II JS logic control
- Google Earth engine - the use of the neighborhood tobands function
猜你喜欢

在混合云中管理数据库:八个关键注意事项

See project code Note 1

Pain and happiness -nio programming

Notes of Teacher Li Hongyi's 2020 in-depth learning series 7

2. Load test

Salesforce zero foundation learning (116) workflow - & gt; On flow

云计算三类巨头:IaaS、PaaS、SaaS,分别是什么意思,应用场景是什么?

Qt项目-安防监控系统(各个界面功能实现)

50 places are limited to open | with the news of oceanbase's annual press conference coming!
![[acwing周赛复盘] 第 61 场周赛20220723](/img/8b/df2c8d516db1e7e5f2d50bcf62b2b1.png)
[acwing周赛复盘] 第 61 场周赛20220723
随机推荐
First experience of flask
QT | event system qevent
剖析kubernetes集群内部DNS解析原理
2022 the most NB JVM foundation to tuning notes, thoroughly understand Alibaba P6 small case
SQLite database operation
Pain and happiness -nio programming
NFT chain game system development metauniverse gamefi construction
Notes of Teacher Li Hongyi's 2020 in-depth learning series 7
[Nuxt 3] (十)运行时配置
With screen and nohup running, there is no need to worry about deep learning code anymore | exiting the terminal will not affect the operation of server program code
The laneatt code is reproduced and tested with the video collected by yourself
The new version of SSM video tutorial in shangsilicon valley was released
Leetcode 1260. two dimensional grid migration: two solutions (k simulations / one step)
LeetCode_ 6124_ The first letter that appears twice
线段树杂谈
Google Earth engine - the use of the neighborhood tobands function
How painful is it to write unit tests? Can you do it
EF core: self referencing organizational structure tree
Wechat applet development learning 5 (custom components)
Opengauss kernel analysis: query rewriting