Prometheus - Node Exporter

本文涉及的产品
可观测监控 Prometheus 版,每月50GB免费额度
简介: Exporter 是由于向 Prometheus 提供监控数据的程序,通常 Exporter 也抽象成一个 Target, Prometheus 通过 Pull 模式往 Target 中获取监控数据。

Exporter 是由于向 Prometheus 提供监控数据的程序,通常 Exporter 也抽象成一个 Target, Prometheus 通过 Pull 模式往 Target 中获取监控数据。

来源区分

社区提供的 Exporter

自定义的 Exporter


支持方式区分

独立的 Exporter 去暴露服务,例如 MySQL Exporter、Consul Exporter

服务自包含的 Exporter,例如 Kubelet 内置 cAdvisor、etcd



https://github.com/prometheus/node_exporter

Node Exporter 部署


Node Exporter 在 Kubernetes 上可以直接通过 DaemonSet 的方式在每一个节点上启动一个Pod

并且和宿主机共用同一个 Network Namespace 或者通过 HostNetwork 的方式暴露 Metrics 端口


apiVersion: apps/v1
kind: DaemonSet
metadata:  name: node-exporter-daemonset
  namespace: monitoring
spec:  selector:    matchLabels:      app: node-exporter-daemonset
  template:    metadata:      labels:        app: node-exporter-daemonset
    spec:      containers:        - image: 'prom/node-exporter:v1.1.2'          name: node-exporter-daemonset
          ports:- containerPort: 9100              hostPort: 9100              name: metrics
              protocol: TCP
      dnsPolicy: ClusterFirst
      hostNetwork: true      volumes:        - hostPath:            path: /proc
            type: ''          name: proc
        - hostPath:            path: /sys
            type: ''          name: sys
        - hostPath:            path: /
            type: ''          name: root
---    spec:      containers:          image: 'prom/node-exporter:v1.1.2'          name: node-exporter-daemonset
          ports:            - containerPort: 9528              name: metrics
              protocol: TCP
 hostNetwork: true


Node Exporter 数据暴露


通过 http://NodeIP:9100/metrics 去查看暴露的数据

image.jpeg



配置 Prometheus 采集规则


cat prometheus.yml

global:  scrape_interval:     15s
  evaluation_interval: 15s
scrape_configs:  - job_name: 'node-exporter'    file_sd_configs:    - files:      - targets/node-exporter.yml
      refresh_interval: 1m
cat targets/node-exporter.yml
- targets:  - "172.20.31.195:9100"  - "172.20.31.196:9100"  - "172.20.31.197:9100"


# 效果同样,只不过以下这种可以根据不同的目标去配置标签等信息。

cat targets/node-exporter.yml

- targets: ["172.20.31.195:9100"]- targets: ["172.20.31.196:9100"]- targets: ["172.20.31.197:9100"]

image.jpeg


Grafana

Dashboard ID:  11074

image.jpeg









目录
相关文章
|
消息中间件 Prometheus 监控
Prometheus实战篇:什么是Exporter
所有可以向Prometheus提供监控样本数据的程序都可以被称为一个Exporter.而Exporter的一个实例称为target,如图下所示, Prometheus通过轮询的方式定期从这些target中获取样本数据
|
7月前
|
存储 Prometheus 监控
Prometheus 深度指南:设计理念 · PromQL · Exporter · Thanos
Prometheus 是一款开源的系统监控与报警工具,专为云原生环境设计。它采用拉取模型采集数据,内置高效的本地时序数据库(TSDB),支持丰富的指标类型和四个黄金指标(延迟、流量、错误、饱和度)。其查询语言 PromQL 功能强大,可灵活聚合和分析时间序列数据。此外,通过 Exporter 机制,Prometheus 能轻松扩展到各种系统和服务。针对大规模场景,Thanos 提供高可用解决方案,整合多 Prometheus 实例,实现全局视图和长期存储。整体架构简洁可靠,适用于动态分布式环境。
1021 10
Prometheus 深度指南:设计理念 · PromQL · Exporter · Thanos
|
8月前
|
Prometheus 运维 监控
运维实战来了!如何构建适用于YashanDB的Prometheus Exporter
今天分享的是构建YashanDB Exporter的核心设计理念和关键方法,希望也能为你的运维实战加分!
|
Prometheus 监控 Cloud Native
Prometheus中的Exporter详解
【10月更文挑战第25天】Prometheus Exporter分为直接采集(如cAdvisor, Kubernetes)和间接采集(如Node Exporter)两类。
|
Prometheus 监控 Cloud Native
prometheus学习笔记之node-export
prometheus 监控 node-exporter
|
存储 Prometheus 监控
服务搭建篇(一) 搭建基于prometheus + node_exporter + grafana + Alertmanager 的监控报警系统 , 保姆级教程
Alertmanager处理客户端应用程序(如Prometheus服务器)发送的警报。它负责重复数据删除、分组,并将它们路由到正确的接收器集成,如电子邮件、PagerDuty或OpsGenie。它还负责静音和抑制警报
718 0
|
Prometheus 监控 Cloud Native
性能监控之 node_exporter+Prometheus+Grafana 实现主机监控
【8月更文挑战第3天】性能监控之 node_exporter+Prometheus+Grafana 实现主机监控
1906 0
|
Prometheus 监控 Cloud Native
如何使用 Node Exporter 监控 Linux 上的磁盘 I/O
如何使用 Node Exporter 监控 Linux 上的磁盘 I/O
785 0
|
Prometheus Cloud Native 容器
Prometheus exporter的Node exporter是可以独立安装,用来测试的
现在慢慢在把prometheus operator的一些概念组织完整。 https://github.com/coreos/prometheus-operator/tree/master/contrib/kube-prometheus 这个全家桶是值得关注的,里面的概念和步骤要领会。
2434 0
|
4月前
|
JavaScript Unix Linux
nvm与node.js的安装指南
通过以上步骤,你可以在各种操作系统上成功安装NVM和Node.js,从而在不同的项目中灵活切换Node.js版本。这种灵活性对于管理不同项目的环境依赖而言是非常重要的。
1085 11