Prometheus笔记-Label标签
1.Prometheus笔记-安装
2.Prometheus笔记-Label标签
3.Prometheus笔记-file_sd_config4.Prometheus笔记-监控docker容器5.Prometheus笔记-Grafana可视化6.Prometheus笔记-安装Node_exporter7.Prometheus笔记-配置文件字段解析8.Prometheus笔记-安装blackbox_exporter9.Prometheus笔记-设置Basic_auth登录校验10.Prometheus笔记-Docker部署Prometheus11.Prometheus笔记-监控Nginx12.Prometheus笔记-告警规则配置Label
Lable是为了方便管理及查询监控目标,在后续写promtheus查询语法的时候需要使用标签作为查询条件
配置文件
# A scrape configuration containing exactly one endpoint to scrape: # Here it's Prometheus itself. scrape_configs: # 定义一个job名称 - job_name: "prometheus" # 默认指标地址 '/metrics' metrics_path: '/metrics' # scheme defaults to 'http'. scheme: 'http' # 静态指定每一个监控目标 static_configs: # 监控目标节点地址,可以并列写入多个目标节点地址(格式为 机器ip:端口),以逗号隔开 - targets: ["localhost:9090"] # 标签 labels: env: 'test'
上文配置文件17,18两行实现了新增一个label标签 env
显示效果
作者:jruing
出处:https://www.cnblogs.com/jruing/p/17057597.html
版权:本作品采用「署名-非商业性使用-相同方式共享 4.0 国际」许可协议进行许可。
本文来自博客园,作者:Jruing,转载请注明原文链接:https://www.cnblogs.com/jruing/p/17057597.html
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 2025年我用 Compose 写了一个 Todo App
· 张高兴的大模型开发实战:(一)使用 Selenium 进行网页爬虫