Prometheus安装与配置

简介: Prometheus安装与配置

前言

借助docker来安装,新建目录docker-monitor,在里面创建文件docker-compose.yml


一、docker-compose.yml

version: "3"
services:
  prometheus:
    image: prom/prometheus:v2.4.3
    container_name: 'prometheus'
    volumes:
    - ./prometheus/:/etc/prometheus/    #映射prometheus的配置文件
    - /etc/localtime:/etc/localtime:ro  #同步容器与宿主机的时间,这个非常重要,如果时间不一致,会导致prometheus抓不到数据
    ports:
    - '9090:9090'

二、prometheus.yml

在docker-monitor目录下新增prometheus目录,在里面创建prometheus配置文件prometheus.yml

global:  #全局配置
  scrape_interval:   15s  #全局定时任务抓取性能数据间隔
scrape_configs:  #抓取性能数据任务配置
- job_name:       'tulingmall-order'  #抓取订单服务性能指标数据任务,一个job下可以配置多个抓紧的targets,比如订单服务多个实例机器
  scrape_interval: 10s  #每10s抓取一次
  metrics_path: '/actuator/prometheus'  #抓取的数据url
  static_configs:
  - targets: ['192.168.31.60:8844']  #抓取的服务器地址
    labels:
      application: 'tulingmall-order-label'  #抓取任务标签
- job_name: 'prometheus'  #抓取prometheus自身性能指标数据任务
  scrape_interval: 5s
  static_configs:
  - targets: ['localhost:9090']

三、启动

在docker-monitor目录下执行如下命令启动prometheus

在浏览器访问prometheus:http://106.14.132.94:9090/graph



总结

提示:以上就是今天要讲的内容,本文仅仅简单介绍了Prometheus安装与配置

相关文章
|
19天前
|
Prometheus 监控 Kubernetes
Prometheus + Grafana安装
Prometheus + Grafana安装
|
19天前
|
Prometheus Cloud Native Java
微服务框架(二十三)Prometheus + Grafana 安装、配置及使用
此系列文章将会描述Java框架Spring Boot、服务治理框架Dubbo、应用容器引擎Docker,及使用Spring Boot集成Dubbo、Mybatis等开源框架,其中穿插着Spring Boot中日志切面等技术的实现,然后通过gitlab-CI以持续集成为Docker镜像。 本文为Prometheus + Grafana 安装、配置及使用 本系列文章中所使用的框架版本为Spring ...
|
12天前
|
Prometheus 监控 Cloud Native
Prometheus监控平台配置--监控集群资源信息
在scrape_configs 配置项下添加Linux 监控的job,其中 IP 修改为上面部署node_exporter机器的ip,端口号为9100,需要注意缩进。
174 6
|
19天前
|
Prometheus 监控 Cloud Native
使用Prometheus配置监控与报警
通过以上步骤,你可以使用Prometheus和Alertmanager实现监控和报警配置,以确保系统在出现性能问题或故障时能够及时通知相关人员。欢迎关注威哥爱编程,一起学习成长。
143 0
|
19天前
|
Prometheus 监控 Cloud Native
springboot配置Prometheus
springboot配置Prometheus
|
19天前
|
Prometheus 监控 Cloud Native
Prometheus 安装与配置
Prometheus 安装与配置
|
19天前
|
Prometheus 监控 Cloud Native
使用 Prometheus 配置 SLO 监控和告警
使用 Prometheus 配置 SLO 监控和告警
|
19天前
|
存储 Prometheus 监控
Prometheus Alertmanager 生产配置趟过的坑总结
Prometheus Alertmanager 生产配置趟过的坑总结
|
19天前
|
Prometheus Kubernetes Cloud Native
kubernetes安装Prometheus
##### 安装 在目标集群上,执行如下命令: ```shell kubectl apply -f https://github.com/512team/dhorse/raw/main/conf/kubernetes-prometheus.yml
|
19天前
|
Prometheus Cloud Native Linux
Linux下安装prometheus & grafana
Linux下安装prometheus & grafana
105 0