Docker运行Prometheus(普罗米修斯)

2023-05-16

1.编辑yaml格式,进行自我监控

# mkdir /etc/prometheus
# cd /etc/prometheus/

# vi /etc/prometheus/prometheus.yml

global:
  scrape_interval:     15s # By default, scrape targets every 15 seconds.

  # Attach these labels to any time series or alerts when communicating with
  # external systems (federation, remote storage, Alertmanager).
  external_labels:
    monitor: 'codelab-monitor'

# 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=<job_name>` to any timeseries scraped from this config.
  - job_name: 'prometheus'

    # Override the global default and scrape targets from this job every 5 seconds.
    scrape_interval: 5s

    static_configs:
      - targets: ['localhost:9090']


或者
global:
  scrape_interval: 15s
  scrape_timeout: 10s
  evaluation_interval: 1m
  external_labels:
    monitor: codelab-monitor
scrape_configs:
- job_name: prometheus
  honor_timestamps: true
  scrape_interval: 5s
  scrape_timeout: 5s
  metrics_path: /metrics
  scheme: http
  static_configs:
  - targets:
    - localhost:9090


2.运行Docker的prometheus(普罗米修斯)容器

# docker run \
    -p 9090:9090 \
    -v /etc/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml \
    prom/prometheus

level=info ts=2020-01-17T15:37:54.425Z caller=main.go:294 msg="no time or size retention was set so using the default time retention" duration=15d
level=info ts=2020-01-17T15:37:54.425Z caller=main.go:330 msg="Starting Prometheus" version="(version=2.15.2, branch=HEAD, revision=d9613e5c466c6e9de548c4dae1b9aabf9aaf7c57)"
level=info ts=2020-01-17T15:37:54.425Z caller=main.go:331 build_context="(go=go1.13.5, user=root@688433cf4ff7, date=20200106-14:50:51)"
level=info ts=2020-01-17T15:37:54.425Z caller=main.go:332 host_details="(Linux 3.10.0-957.el7.x86_64 #1 SMP Thu Nov 8 23:39:32 UTC 2018 x86_64 bf94042176af (none))"
level=info ts=2020-01-17T15:37:54.425Z caller=main.go:333 fd_limits="(soft=1048576, hard=1048576)"
level=info ts=2020-01-17T15:37:54.426Z caller=main.go:334 vm_limits="(soft=unlimited, hard=unlimited)"
level=info ts=2020-01-17T15:37:54.430Z caller=main.go:648 msg="Starting TSDB ..."
level=info ts=2020-01-17T15:37:54.430Z caller=web.go:506 component=web msg="Start listening for connections" address=0.0.0.0:9090
level=info ts=2020-01-17T15:37:54.437Z caller=head.go:584 component=tsdb msg="replaying WAL, this may take awhile"
level=info ts=2020-01-17T15:37:54.440Z caller=head.go:632 component=tsdb msg="WAL segment loaded" segment=0 maxSegment=0
level=info ts=2020-01-17T15:37:54.441Z caller=main.go:663 fs_type=XFS_SUPER_MAGIC
level=info ts=2020-01-17T15:37:54.441Z caller=main.go:664 msg="TSDB started"
level=info ts=2020-01-17T15:37:54.441Z caller=main.go:734 msg="Loading configuration file" filename=/etc/prometheus/prometheus.yml
level=info ts=2020-01-17T15:37:54.442Z caller=main.go:762 msg="Completed loading of configuration file" filename=/etc/prometheus/prometheus.yml
level=info ts=2020-01-17T15:37:54.442Z caller=main.go:617 msg="Server is ready to receive web requests."

3.打开浏览器 ,输入ip:9090

 

 

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Docker运行Prometheus(普罗米修斯) 的相关文章

随机推荐

  • Mac打开访达后如何快速知道当前文件绝对路径?

    百度查了多种方法 xff0c 还是下面这个快捷键最实用 比如我打开访达以后 xff0c 想知道当前Hello vue文件的绝对路径 xff0c 此时在当前界面直接按快捷键 option 43 command 43 c就可以复制当前文件路径到
  • 一元正态分布

    d import numpy as np import matplotlib pyplot as plt from scipy stats import norm 生成100个正态分布数据 xff0c 均值为1 xff0c 标准差为2 da
  • nohup命令详解

    nohup命令详解 一 背景说明 xff1a 启动服务的时候 xff0c 如果使用如下命令 xff0c 则会在start sh脚本所在的目录下 xff0c 产生一个名为 nohup out 的输出文件 nohup startup sh am
  • nohup命令详解

    nohup命令详解 一 背景说明 xff1a 启动服务的时候 xff0c 如果使用如下命令 xff0c 则会在start sh脚本所在的目录下 xff0c 产生一个名为 nohup out 的输出文件 span class token fu
  • Spring Boot启动后直接没有任何警告报错信息,打印`Process finished with exit code 0`直接退出

    Spring Boot启动后直接没有任何警告报错信息 xff0c 打印Process finished with exit code 0直接退出 日志 xff1a span class token number 2023 span 02 1
  • systemctl 启动/停止/重新加载 nginx

    systemctl 启动 停止 重新加载 nginx 一 新建nginx service脚本 span class token function sudo span span class token function vim span us
  • Unable to determine application id: com.android.tools.idea.run.ApkProvisionException: ERROR: APK pat

    Unable to determine application id com android tools idea run ApkProvisionException ERROR APK path is not specified for
  • Java获取文件的MD5

    Java获取文件的MD5 主要是通过读取文件的字符流 xff0c 然后赋值给MessageDigest对象 xff0c 最后将文件流转换成16进制的字符串 span class token keyword import span span
  • android整合好视通sdk经验总结(二)

    一 无法正常访问好视通服务接口 当按照android整合好视通sdk经验总结 xff08 一 xff09 步骤整合完毕后 xff0c 在这里修改申请的应用id和服务地址 修改完毕后运行发现无法正常初始化sdk xff0c 错误码30 xff
  • 视觉SLAM⑤--相机与图像

    目录 5 0 本章简介 5 1 相机模型 5 1 1针孔相机模型 5 1 2 畸变模型 5 1 3 双目相机模型 5 1 4 RGB D相机模型 5 2 图像 5 3 实践 xff1a 计算机中的图像 5 3 1 OpenCV的基本使用方法
  • 视觉SLAM⑩后端Ⅱ(滑动窗口滤波和优化与位姿图)

    目录 10 0 本章概述 10 1 滑动窗口滤波和优化 10 1 1 实际环境下的BA结构 10 1 2 滑动窗口法 10 2 位姿图 10 2 1 位姿图的意义 10 2 2位姿图的优化 10 3 非线性优化整体总结 xff1a 前端 后
  • 学习C++:C++进阶(五)CMake应用篇---集成第三方库和依赖管理

    目录 第二部分 xff1a 实用 CMake xff08 Practical CMake Getting Your Hands Dirty with CMake xff09 3 0 集成第三方库和依赖管理 xff08 Integrating
  • 2.ORB-SLAM2改进版本--稠密建图版本解析

    目录 1 修改思路 2 基本概念 nbsp 2 1 统计滤波 2 2 体素滤波
  • FreeRTOS 的命名规则

    初学 FreeRTOS 的用户对其变量和函数的命名比较迷惑 xff0c 下面专门做一下介绍 xff1a 变量 uint32 t 定义的变量都加上前缀 ul u 代表 unsigned 无符号 xff0c l 代表 long 长整型 uint
  • 【单目测距和双目测距比较】

    单目测距和双目测距比较 单 双目方案的优势与难点单目测距双目测距 双目测距实现步骤实现过程 单 双目方案的优势与难点 单目测距 优点 xff1a 单目的优势在于成本较低 xff0c 对计算资源的要求不高 xff0c 系统结构相对简单 缺点
  • ROS学习笔记(3):添加第三方依赖库

    最近在工控机上加入CAN卡 xff0c 想利用CAN卡来做为数据收发 现在在工程中加入CAN卡的头文件和自己做的cpp文档 已经申明了 函数 xff0c 但是还是会出现上图所示的错误 xff0c 经过一晚上的战斗算是搞清楚了 感谢 64 头
  • Java面试题及答案2019版(上)

    1 面向对象的特征有哪些方面 xff1f 答 xff1a 面向对象的特征主要有以下几个方面 xff1a 抽象 xff1a 抽象是将一类对象的共同特征总结出来构造类的过程 xff0c 包括数据抽象和行为抽象两方面 抽象只关注对象有哪些属性和行
  • git到远程出现的一些问题以及解决方法

    我们首先回顾一下 git reset命令 xff1a 1 git reset mixed xff1a 此为默认方式 xff0c 等同于不带任何参数的git reset 2 git reset soft 回退到某个版本 xff0c 只回退了c
  • CMakeLists.txt 和 package.xml 重要内容详解

    边学边看 xff0c 学到什么分享什么 CMakeLists txt 构建配置文件package xml 功能包配置文件 上面的意思个人理解就是功能包本身如果要在别处运行 xff0c 需要什么样的条件在xml文件中看 功能包自身 xff0c
  • Docker运行Prometheus(普罗米修斯)

    1 编辑yaml格式 xff0c 进行自我监控 mkdir etc prometheus cd etc prometheus vi etc prometheus prometheus yml global scrape interval 1