Pinpoint一个韩国团队开源的产品,运用了字节码增强技术,只需要在启动时添加启动参数即可,对代码无侵入,目前支持Java和PHP语言,底层采用HBase来存储数据,探针收集的数据粒度非常细,但性能损耗大,因其出现的时间较长,完成度也很高,应用的公司较多
CAT是由国内美团点评开源的,基于Java语言开发,目前提供Java、C/C++、Node.js、Python、Go等语言的客户端,监控数据会全量统计,国内很多公司在用,例如美团点评、携程、拼多多等,CAT跟下边要介绍的Zipkin都需要在应用程序中埋点,对代码侵入性强。
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-7LyoSSzs-1668243114386)(images/监控对比.png)]在这里插入图片描述



[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-kPtIAVYD-1668243114388)(images/zabbix-promet.png)]

# 可以去官网下载最新版:https://prometheus.io/download/
tar -zxvf node_exporter-0.16.0.linux-amd64.tar.gz
# 后台运行node_exporter
./node_exporter &
在浏览器输入监控端ip及端口进行访问,进入页面如下
http://182.43.165.162:9100/metrics
prometheus 服务端安装
# 可以去官网下载最新版:https://prometheus.io/download/ 解压
tar -zxf prometheus-2.3.2.linux-amd64.tar.gz
## 启动
./prometheus --config.file=./prometheus.yml &
## 控制页面访问
http://182.43.165.162:9090/targets
- rate(jvm_buffer_memory_used_bytes {instance="182.43.165.162:18087"}[5m])[10m:1m]
rate(jvm_buffer_memory_used_bytes {job="my-cpn-test"}[5m])[10m:1m]
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
# The job name is added as a label `job=` to any timeseries scraped from this config.
- job_name: "prometheus"
# metrics_path defaults to '/metrics'
# scheme defaults to 'http'.
static_configs:
- targets: ["182.43.165.162:9090"]
- job_name: 'my-server' #新增的配置
static_configs:
- targets: ['182.43.165.162:9100']
- job_name: 'pushgateway' # 配置pushgateway
static_configs:
- targets: ['182.43.165.162:9091']
# labels:
# instance:pushgateway
- job_name: 'my-cpn-test' # 配置
metrics_path: "/bmp-cpn-service/actuator/prometheus"
static_configs:
- targets: ['gateway.test.vevor.net']
- job_name: 'my-test-local' #
metrics_path: "/actuator/prometheus"
static_configs:
- targets: ['182.43.165.162:18087']
jvm_memory_used_bytes{application="learn_app_test",area="heap",id="PS Old Gen",}
<!-- spring boot health健康检查包 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- prometheus监控 -->
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
<version>1.3.16</version>
</dependency>
management:
endpoints:
web: #开启web监控端点
exposure:
include: '*' #自定义端点的启用和关闭
enabled-by-default: true
server:
port: 18087 #自定义端口号。正常是首位为1后面加上服务端口号,具体和运维商量
metrics:
tags: #对外暴露tag
application: ${spring.application.name}
访问地址
http://182.43.165.162:18087/actuator/prometheus
在prometheus.yml配置
指标学习
| 类型 | 描述 | 例如 |
|---|---|---|
| Counter | counter 是一个累积计数的指标,仅支持增加或者重置为0(只增不减 )。例如:可以用来统计服务请求的数量,任务完成数量,或者出错的数量。 | |
| Gauge | gauge是一个纯数值型的能够经常进行增加或者减少的指标。例如用来做温度的计数,内存的使用,同样也可以用来使用计算服务请求数量。 | |
| Histogram | histogram 在一段时间内进行采样,并能够对指定区间以及总数进行统计. | |
| Summary | summary与histogram类似,用于表示一段时间内的采样数据,但它直接存储了分位数,而不是通过区间来计算。 |

1. 实际演示机器的几个指标
1. node_load1
2. node_memory_memFree_bytes
3. node_filesystem_free_bytes




