37 lines
1.4 KiB
Markdown
37 lines
1.4 KiB
Markdown
---
|
||
title: "Prometheus"
|
||
type: concept
|
||
tags: [monitoring, prometheus, time-series, devops]
|
||
sources: [家庭监控方案-prometheus-grafana-node-exporter-cadvisor-blackbox]
|
||
last_updated: 2026-04-16
|
||
---
|
||
|
||
## Definition
|
||
Prometheus 是开源的时序数据库和监控系统,采用拉取(Pull)模式采集指标,支持 PromQL 查询语言和告警规则引擎。
|
||
|
||
## Key Features
|
||
- **拉取模式**:主动从 exporters 拉取指标数据
|
||
- **PromQL**:强大的时序数据查询语言
|
||
- **告警规则**:支持定义告警条件和阈值
|
||
- **多数据源**:可对接多种 exporters(node_exporter、cAdvisor、blackbox_exporter)
|
||
- **服务发现**:支持动态服务发现(Kubernetes、Consul 等)
|
||
|
||
## Architecture
|
||
- **Prometheus Server**:采集、存储时序数据
|
||
- **Exporters**:指标采集器(node_exporter、cAdvisor、blackbox_exporter)
|
||
- **Alertmanager**:告警分发和处理
|
||
- **Pushgateway**:支持推送模式的网关(用于短期任务)
|
||
|
||
## Common Metrics Types
|
||
- Counter:递增计数器
|
||
- Gauge:当前值(可增可减)
|
||
- Histogram:直方图分布
|
||
- Summary:分位数统计
|
||
|
||
## Connections
|
||
- [[Prometheus]] → scrapes → [[node_exporter]]
|
||
- [[Prometheus]] → scrapes → [[cAdvisor]]
|
||
- [[Prometheus]] → scrapes → [[Blackbox_exporter]]
|
||
- [[Prometheus]] → sends_alerts → [[Alertmanager]]
|
||
- [[Prometheus]] ← visualized_by → [[Grafana]]
|
||
- [[Prometheus]] ← core_component → [[监控可观测性]] |