Prometheus对Windows有相关的支持  下载地址:https://prometheus.io/download/

wget https://github.com/prometheus/prometheus/releases/download/v2.5.0/prometheus-2.5.0.linux-amd64.tar.gz

如果需要也可以下载其他组件支持

解压安装:

tar -xvf prometheus-2.5..linux-amd64.tar.gz

查看配置:cd /目录查看配置

 cd prometheus-2.5..linux-amd64

配置如下:

# my global config
global:
scrape_interval: 15s # Set the scrape interval to every seconds. Default is every minute.
evaluation_interval: 15s # Evaluate rules every seconds. The default is every minute.
# scrape_timeout is set to the global default (10s). # Alertmanager configuration
alerting:
alertmanagers:
- static_configs:
- targets:
# - alertmanager: # Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
# - "first_rules.yml"
# - "second_rules.yml" # 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' # metrics_path defaults to '/metrics'
# scheme defaults to 'http'. static_configs:
- targets: ['localhost:9090']
~
~
~
~
"prometheus.yml" 29L, 925C

scrape_interval:收集频率

evaluation_interval:分析评率

alerting:预警相关设置

scrape_configs:分析配置,static_configs中要特别说明下收集目标,targets:[localhost:9090] 这里是数组 可以配置多个

注意:这里跟前面的 InfluxDB+AppMetrics 不一样,AppMetrics是在应用程序中去主动推送分析数据到 InfluxDB,而Prometheus是通过targets配置的地址去获取,但是在应用程序端也需要使用客户端中间件处理下

这里默认收集localhost:9090

下面我们后台启动下Prometheus,可以指定配置启动

./prometheus --config.file=prometheus.yml &

在打开9090端口测试下:

firewall-cmd --zone=public --add-port=/tcp --permanent
firewall-cmd --reload

浏览下

可以选择指定的分析指标

选择一个指标查询看下

我们也可以通过图表看查看分析情况,并添加添加多个图表分析

当然还有一些额外的处理,比如监控节点展示、服务发现等其他细节用法参考官方文档

  


 
												

.NetCore下使用Prometheus实现系统监控和警报 (二)Linux安装的更多相关文章

  1. .NetCore下使用Prometheus实现系统监控和警报 (一)介绍【译】

    [译]原文https://prometheus.io/docs/introduction/overview 什么是Prometheus? Prometheus是一个开源系统监控和警报工具包,最初起源于 ...

  2. .NetCore下使用Prometheus实现系统监控和警报 (六)进阶Grafana集成自定义收集指标

    Prometheus中包含了很多收集指标,那么我们怎来在Grafana中来使用呢? 接下来我们还是以之前自定义的来演示如图:我们在Prometheus中已经可以看到这个之前我们自定义的类型了 关于Gr ...

  3. .NetCore下使用Prometheus实现系统监控和警报 (五)进阶自定义收集指标 之 Counter

    Prometheus下面定了四种类型的收集方式,下面我们主要来来说下Counter的使用 Nuget导入Prometheus.AspNetCore包 下面先来看下我的Prometheus配置,这里我没 ...

  4. .NetCore下使用Prometheus实现系统监控和警报 (四)客户端代码处理

    在代码中使用就比较简单了 Nuget包获取下 prometheus-net prometheus-net.AspNetCore 然后添加中间件就行了 app.UseMetricServer(); 默认 ...

  5. .NetCore下使用Prometheus实现系统监控和警报 (三)集成Grafana

    有了前面InfluxDB的经验,这里就很好处理了,数据类型选择Prometheus选地址等,填好保存 同样通过导入数据处理,我们在https://grafana.com/dashboards上选择Da ...

  6. VMware系统运维(二)安装Microsoft .NET 3.5

    1.安装vmware vSphere 5.5 之前先安装Microsoft .NET 3.5. 2.安装Microsoft .NET3.5,添加角色和功能. 3.勾选.NET Framework 3. ...

  7. java系统监控分析Jprofile下载及安装配置【转】

    JProfiler是一个全功能的Java剖析工具(profiler),专用於分析J2SE和J2EE应用程式.它把CPU.线程和记忆体的剖析组合在一个强大的应用中.JProfiler可提供许多IDE整合 ...

  8. Linux系统运维笔记(二),Linux文件编辑命令

    Linux系统运维笔记 Linux文件编辑命令 首先我们使用命令 vi filename 打开一个文件,这个时候进入到的是命令模式 接下来我们按i,然后键盘随便输入写内容. 然后按ESC重新进入到命令 ...

  9. go-zero docker-compose 搭建课件服务(七):prometheus+grafana服务监控

    0.转载 go-zero docker-compose 搭建课件服务(七):prometheus+grafana服务监控 0.1源码地址 https://github.com/liuyuede123/ ...

随机推荐

  1. bzoj5301[CQOI2018]异或序列

    题意 已知一个长度为 n 的整数数列 a[1],a[2],-,a[n] ,给定查询参数 l.r ,问在 [l,r] 区间内,有多少连续子 序列满足异或和等于 k . 也就是说,对于所有的 x,y (l ...

  2. Luogu4783 【模板】矩阵求逆(高斯消元)

    对矩阵进行高斯消元直至消为单位矩阵,并在另一个单位矩阵上对其做同样的操作即可. 模意义下的高斯消元可以直接计算系数来避免整行的辗转相除. 还不知道有什么用. #include<iostream& ...

  3. maven上传jar包到nexus私服后的存放路径 以及 使用IDEA上传jar包的步骤

    maven上传jar包到nexus私服的方法,网上大神详解很多,那么上传后的jar包存放到哪里了呢? 在下使用nexus3.2.1版本,在本地搭建了私服,使用maven上传jar包.最后结果如下: 点 ...

  4. (转)CS0016: 未能写入输出文件

    转自:http://www.pageadmin.net/article/20130305/537.html 编译错误 说明: 在编译向该请求提供服务所需资源的过程中出现错误.请检查下列特定错误详细信息 ...

  5. winform里宿主WCF,并传递winform变量给WCF

    最近客户要求把服务器端程序里的二个功能用service的方式提供出来,方便调用.首先想着单独建一个wcf 服务的项目,但是因为要用到server端程序winform里的变量,因此只能在winform里 ...

  6. Linux通过端口转发来访问内网服务(端口转发访问阿里云Redis数据库等服务)

    # 安装rinetd wget http://www.boutell.com/rinetd/http/rinetd.tar.gz&&tar -xvf rinetd.tar.gz& ...

  7. chessboard

    题意:n*n的矩阵,m次赋值一个子矩阵为c,最后输出答案. n<=1e3 m<=1e5 解:倒序处理. 拆行处理. 每行内并查集维护未被赋值的地方. 这样每个地方最多被赋值一次,每次修改要 ...

  8. shell中exec命令

    1.find中的-exec参数 在当前目录下(包含子目录),查找所有txt文件并找出含有字符串"bin"的行 find ./ -name "*.txt" -ex ...

  9. SQL Server手把手教你使用profile进行性能监控

    介绍 经常会有人问profile工具该怎么使用?有没有方法获取性能差的sql的问题.自从转mysql我自己也差不多2年没有使用profile,忽然profile变得有点生疏不得不重新熟悉一下.这篇文章 ...

  10. 小贾漫谈——Java反射

    一.Class的API 二.测试使用的JavaBean class Admin{ //字段 public String userName; public String pwd; private int ...