Prometheus-自定义监控指标 pushgateway

本文涉及的产品
可观测监控 Prometheus 版,每月50GB免费额度
EMR Serverless StarRocks,5000CU*H 48000GB*H
简介: Prometheus-自定义监控指标 pushgateway

自定义监控指标 pushgateway

# 下载地址
https://github.com/prometheus/pushgateway/releases/download/v1.4.0/pushgateway-1.4.0.linux-amd64.tar.gz

# 解压
tar xf pushgateway-1.4.0.linux-amd64.tar.gz
mv pushgateway-1.4.0.linux-amd64 pushgateway-1.4.0

# 添加配置文件
vim /usr/lib/systemd/system/pushgateway.service
                            
[Unit]
Description=pushgateway
After=network.target

[Service]
ExecStart=/opt/pushgateway-1.4.0/pushgateway  

Restart=on-failure

[Install]
WantedBy=multi-user.target

# 启动
/opt/pushgateway-1.4.0/pushgateway  --web.listen-address="0.0.0.0:9091"
systemctl daemon-reload
systemctl start pushgateway.service

# Prometheus配置
- job_name: 'pushgateway'
  static_configs:
  - targets: ['pushgatewayIP:9091']
  honor_labels: true        #作用:如果没有设置instance标签,Prometheus服务器也会附加标签,否则instance标签值会为空


cat <<EOF | curl --data-binary @- http://x.x.x.x:9091/metrics/job/some_job/instance/some_instance
# TYPE some_metric counter
some_metric{label="val1"} 42
# TYPE another_metric gauge
# HELP another_metric Just an example.
another_metric 2398.283
EOF

echo "some_metric 3.14" | curl --data-binary @- http://pushgateway.example.org:9091/metrics/job/some_job
echo "zhangning 3306" | curl --data-binary @- http://x.x.x.x:9091/metrics/job/redis/instance/3306

echo "key value" | curl --data-binary @- http://ip地址:9091/metrics/job标签名/job标签命名/instance名/实例标签命名




https://www.cnblogs.com/zqj-blog/p/11106724.html
https://www.cnblogs.com/zqj-blog/p/11024834.html
https://github.com/cppla/ServerStatus
https://github.com/tianshiyeben/wgcloud

# 接口监控
https://github.com/liwei128/apimonitor
https://github.com/jsyzjhj/httpMonitor
https://github.com/yjlch1016/dmonitor
https://github.com/yangziwen/web-monitor
相关实践学习
容器服务Serverless版ACK Serverless 快速入门:在线魔方应用部署和监控
通过本实验,您将了解到容器服务Serverless版ACK Serverless 的基本产品能力,即可以实现快速部署一个在线魔方应用,并借助阿里云容器服务成熟的产品生态,实现在线应用的企业级监控,提升应用稳定性。
相关文章
|
22天前
|
Prometheus 监控 Cloud Native
【监控】prometheus传统环境监控告警常用配置
【监控】prometheus传统环境监控告警常用配置
【监控】prometheus传统环境监控告警常用配置
|
12天前
|
Prometheus 监控 Cloud Native
自定义grafana_table(数据源Prometheus)
综上所述,自定义 Grafana 表格并将 Prometheus 作为数据源的关键是理解 PromQL 的查询机制、熟悉 Grafana 面板的配置选项,并利用 Grafana 强大的转换和自定义功能使数据展示更为直观和有洞见性。随着对这些工具更深入的了解,您将可以创建出更高级的监控仪表盘,以支持复杂的业务监控需求。
47 1
|
13天前
|
存储 Prometheus 监控
Grafana 与 Prometheus 集成:打造高效监控系统
【8月更文第29天】在现代软件开发和运维领域,监控系统已成为不可或缺的一部分。Prometheus 和 Grafana 作为两个非常流行且互补的开源工具,可以协同工作来构建强大的实时监控解决方案。Prometheus 负责收集和存储时间序列数据,而 Grafana 则提供直观的数据可视化功能。本文将详细介绍如何集成这两个工具,构建一个高效、灵活的监控系统。
50 1
|
16天前
|
Prometheus 监控 Cloud Native
使用Prometheus搞定微服务监控
使用Prometheus搞定微服务监控
使用Prometheus搞定微服务监控
|
29天前
|
Prometheus Kubernetes 监控
Kubernetes(K8S) 监控 Prometheus + Grafana
Kubernetes(K8S) 监控 Prometheus + Grafana
104 2
|
1月前
|
Prometheus 监控 Cloud Native
在 HBase 集群中,Prometheus 通常监控哪些类型的性能指标?
在 HBase 集群中,Prometheus 通常监控哪些类型的性能指标?
|
16天前
|
Prometheus 监控 Cloud Native
基于prometheus的微服务指标监控
基于prometheus的微服务指标监控
|
1月前
|
Prometheus 监控 Cloud Native
|
22天前
|
Prometheus 监控 Cloud Native
在 HBase 集群中,Prometheus 通常监控哪些类型的性能指标?
在 HBase 集群中,Prometheus 通常监控哪些类型的性能指标?
|
1月前
|
Prometheus 监控 Cloud Native
基于Prometheus搭建监控平台
基于Prometheus搭建监控平台