![](/img/trans.png)
[英]Using identification in a label in prometheus. Best practices for labeling
[英]Monitoring using telegraf and prometheus
如何使用 prometheus 和 telegraf 从我的电脑监控另一台服务器? 我需要在他们两个上安装电报吗?
您的问题将受益于更精确的信息,包括对您尝试过的内容的描述(甚至是假设)。 因此,它可能会被标记。
直到那时...
Telegraf 似乎支持 Prometheus 作为 output 插件( 链接)。
所以你应该能够:
假设您使用以下形式的 Telegraf 配置:
[[outputs.prometheus_client]]
## Address to listen on.
listen = ":9273"
您应该能够从 Telegraf 运行的主机浏览|curl http://localhost:9273/metrics
以查看它公开的指标。
注意如果不是
localhost
(127.0.0.1
),则将localhost
替换为主机的名称|地址。
然后你需要配置一个 Prometheus 抓取目标来抓取 Telegraf 指标:
scrape_configs:
# Telegraf
- job_name: "telegraf-agent"
static_configs:
- targets:
- "localhost:9273"
# Self
- job_name: "prometheus-server"
static_configs:
- targets:
- "localhost:9090"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.