macOS Grafana Prometheus
macos Prometheus Grafana
2023-09-14 09:09:52 时间
安装Grafana
╰─➤ brew update
╰─➤ brew install grafana
运行Grafana
╰─➤ brew services start grafana
停止Grafana
brew services stop grafana
升级Grafana
brew update
brew reinstall grafana
╰─➤ grafana-server -v
Version 7.0.0 (commit: unknown-dev, branch: master)
╰─➤ grafana-server -v
Version 7.2.0 (commit: unknown-dev, branch: master)
登陆Grafana
- 默认用户名密码admin
http://localhost:3000/login
安装prometheus
brew install prometheus
运行prometheus
brew services start prometheus
╰─➤ prometheus --version
prometheus, version 2.21.0 (branch: non-git, revision: non-git)
╰─➤ cat /usr/local/etc/prometheus.yml
global:
scrape_interval: 15s
scrape_configs:
- job_name: "prometheus"
static_configs:
- targets: ["localhost:9090"]
prometheus --config.file=/usr/local/etc/prometheus.yml
╰─➤ curl http://localhost:9090/metrics
# HELP go_gc_duration_seconds A summary of the pause duration of garbage collection cycles.
# TYPE go_gc_duration_seconds summary
go_gc_duration_seconds{quantile="0"} 5.0972e-05
go_gc_duration_seconds{quantile="0.25"} 7.9818e-05
go_gc_duration_seconds{quantile="0.5"} 0.000109628
go_gc_duration_seconds{quantile="0.75"} 0.000211169
go_gc_duration_seconds{quantile="1"} 0.000414874
go_gc_duration_seconds_sum 0.004110919
go_gc_duration_seconds_count 28
# HELP go_goroutines Number of goroutines that currently exist.
# TYPE go_goroutines gauge
go_goroutines 38
# HELP go_info Information about the Go environment.
# TYPE go_info gauge
go_info{version="go1.15.1"} 1
http://localhost:9090/graph
http://localhost:9090/metrics
- 查看端口
lsof -i :9090
安装node_exporter
brew install node_exporter
brew services start node_exporter
╰─➤ node_exporter
level=info ts=2020-10-08T10:46:06.898Z caller=node_exporter.go:177 msg="Starting node_exporter" version="(version=1.0.1, branch=, revision=)"
level=info ts=2020-10-08T10:46:06.898Z caller=node_exporter.go:178 msg="Build context" build_context="(go=go1.14.3, user=Homebrew, date=)"
level=info ts=2020-10-08T10:46:06.899Z caller=node_exporter.go:105 msg="Enabled collectors"
level=info ts=2020-10-08T10:46:06.899Z caller=node_exporter.go:112 collector=boottime
level=info ts=2020-10-08T10:46:06.899Z caller=node_exporter.go:112 collector=cpu
level=info ts=2020-10-08T10:46:06.899Z caller=node_exporter.go:112 collector=diskstats
level=info ts=2020-10-08T10:46:06.899Z caller=node_exporter.go:112 collector=filesystem
level=info ts=2020-10-08T10:46:06.899Z caller=node_exporter.go:112 collector=loadavg
level=info ts=2020-10-08T10:46:06.899Z caller=node_exporter.go:112 collector=meminfo
level=info ts=2020-10-08T10:46:06.899Z caller=node_exporter.go:112 collector=netdev
level=info ts=2020-10-08T10:46:06.899Z caller=node_exporter.go:112 collector=textfile
level=info ts=2020-10-08T10:46:06.901Z caller=node_exporter.go:112 collector=time
level=info ts=2020-10-08T10:46:06.901Z caller=node_exporter.go:112 collector=uname
level=info ts=2020-10-08T10:46:06.901Z caller=node_exporter.go:191 msg="Listening on" address=:9100
level=info ts=2020-10-08T10:46:06.901Z caller=tls_config.go:170 msg="TLS is disabled and it cannot be enabled on the fly." http2=false
level=error ts=2020-10-08T10:46:06.902Z caller=node_exporter.go:194 err="listen tcp :9100: bind: address already in use"
http://127.0.0.1:9100/metrics
╰─➤ vim /usr/local/etc/prometheus.yml
global:
scrape_interval: 15s
scrape_configs:
- job_name: "prometheus"
static_configs:
- targets: ["localhost:9090"]
- job_name: "node"
static_configs:
- targets: ["127.0.0.1:9100"]
参考:
相关文章
- 解决 macOS Ventura 使用 ssh/git 等无法正常使用的问题
- Mac苹果笔记本u盘装系统教程-附所有版本MacOS原版镜像和TM镜像
- 重装macOS:值得一试的操作方法(如何重装macos)
- 目MacOS:轻松管理启动项目(macos启动项)
- 恢复系统效能:MacOS 清理四步曲(macos清理)
- MacOS下免费字体的下载与使用(macos下载字体)
- 解决办法MacOS 启动磁盘恢复: 简单易行的解决方法(macos启动磁盘)
- MacOS 终端:让工作更简单(macos终端)
- 支付MacOS不支持银联:一场遗憾的支付之旅(此macos不支持银联)
- MacOS最新版:更新拥抱新技术(macos最新版本下载)
- MacOS:如何正确删除软件(macos删除软件)
- MacOS上移动文件的最佳方式(macos移动文件)
- 安装MacOS下SVN安装指南(macossvn)
- 苹果 iOS/iPadOS 15、macOS 12 公测版 Beta 3 更新
- MacOS开发者:改变未来的技术之路(macos开发者网站)
- 安装安装MacOS:利用镜像快速搞定(macos镜像)
- MacOS下Java开发环境搭建指南(macos开发java)
- 探究macOS的实用性——你认为macOS好用吗?(macos好用吗)
- 谷歌浏览器在macOS上的使用体验(chromemacos)
- MacOS系统盘:舞台背后的幕后英雄。(macos系统盘)
- MacOS最新版:拥抱全新体验(macos最新系统)
- 附件MacOS:邮件附件的简单操作(macos邮件)
- MacOS:慢速之苦(macos慢)
- 化标题:MacOS系统下硬盘格式化指南(macos硬盘格式)
- 微软在macOS老版本上弃用OneDrive同步客户端应用
- 如何使用U盘重装MacOS系统?(u盘重装macos)
- MacOS中快速安装打印机的指南(macos 安装打印机)