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. BZOJ3881 Coci2015Divljak(AC自动机+树上差分+树状数组)

    建出AC自动机及其fail树,每次给新加入的串在AC自动机上经过的点染色,问题即转化为子树颜色数.显然可以用dfs序转成序列问题树状数组套权值线段树解决,显然过不掉.事实上直接树上差分,按dfs序排序 ...

  2. WebSite下创建webapi

    注意这里说的是WebSite,不是Webapp 就是我们常说的新建网站,而不是新建项目 直接上代码: 1 在要在website下创建,那么应该这么干.先添加引用和global.asax 2 然后创建对 ...

  3. 浅入 dancing links x(舞蹈链算法)

    abastract:利用dancing links 解决精确覆盖问题,例如数独,n皇后问题:以及重复覆盖问题. 要学习dacning links 算法,首先要先了解该算法适用的问题,精确覆盖问题和重复 ...

  4. 洛谷 P1852 [国家集训队]跳跳棋 解题报告

    P1852 [国家集训队]跳跳棋 题目描述 跳跳棋是在一条数轴上进行的.棋子只能摆在整点上.每个点不能摆超过一个棋子. 我们用跳跳棋来做一个简单的游戏:棋盘上有3颗棋子,分别在\(a\),\(b\), ...

  5. CodeForces 450B Jzzhu and Sequences (矩阵优化)

    CodeForces 450B Jzzhu and Sequences (矩阵优化) Description Jzzhu has invented a kind of sequences, they ...

  6. 960CSS框架,之前有用过 了解下框架基本原理

    http://blog.sina.com.cn/s/blog_8173443e010160b8.html CSS框架已经出现很长时间了,关于这些框架的用处也被我们讨论了很多遍了.有人说,CSS框架不够 ...

  7. jQueryCDN

    分享几个jquery的几个国内国外的CDN加速节点,方便广大的开发设计者调用和节约空间,官网的总是最新版本的jquery所以不用去担心版本更新问题,其他加速节点可能不会在更新版本,所以取舍问题自己决定 ...

  8. indeed招聘

    https://cn.indeed.com/%E5%B7%A5%E4%BD%9C-%E4%BA%BA%E5%B7%A5%E6%99%BA%E8%83%BD%E5%85%AC%E5%8F%B8-%E5% ...

  9. CCNA学习与实验指南——第3章 以太网

    以太网就是局域网,IEEE制定了802.2和802.3两种标准.802.2规定了OSI模型的数据链路层的上半部分(LLC子层),802.3规定了OSI模型的数据链路层的下半部分和物理层(MAC子层). ...

  10. js拾遗: 函数字面量

    今天落叶同学发我一篇文章,我看到一个"新"名词 "函数字面量" (也可叫直接量),当时我就郁闷了,这是什么东西? 我怎么没听说过..回头翻了下权威指南,在第 4 ...