.NetCore下使用Prometheus实现系统监控和警报 (四)客户端代码处理
在代码中使用就比较简单了
Nuget包获取下
prometheus-net
prometheus-net.AspNetCore
然后添加中间件就行了
app.UseMetricServer();

默认地址都是/metrics,在Prometheus中的targets就是指向了这个地址,当然如果需要认证的话需要处理,Prometheus也需要设置先关认证,这里我写在了GateWay中,允许查看下
http://localhost:5000/metrics
# HELP process_windows_num_threads Total number of threads
# TYPE process_windows_num_threads gauge
process_windows_num_threads
# HELP dotnet_totalmemory Total known allocated memory
# TYPE dotnet_totalmemory gauge
dotnet_totalmemory
# HELP process_windows_processid Process ID
# TYPE process_windows_processid gauge
process_windows_processid
# HELP process_windows_virtual_bytes Process virtual memory size
# TYPE process_windows_virtual_bytes gauge
process_windows_virtual_bytes
# HELP process_windows_open_handles Number of open handles
# TYPE process_windows_open_handles gauge
process_windows_open_handles
# HELP process_windows_private_bytes Process private memory size
# TYPE process_windows_private_bytes gauge
process_windows_private_bytes
# HELP process_cpu_seconds_total Total user and system CPU time spent in seconds.
# TYPE process_cpu_seconds_total counter
process_cpu_seconds_total 1.921875
# HELP process_start_time_seconds Start time of the process since unix epoch in seconds.
# TYPE process_start_time_seconds gauge
process_start_time_seconds 1541669168.15852
# HELP dotnet_collection_count_total GC collection count
# TYPE dotnet_collection_count_total counter
dotnet_collection_count_total{generation=""}
dotnet_collection_count_total{generation=""}
dotnet_collection_count_total{generation=""}
# HELP dotnet_collection_errors_total Total number of errors that occured during collections
# TYPE dotnet_collection_errors_total counter
dotnet_collection_errors_total
# HELP process_windows_working_set Process working set
# TYPE process_windows_working_set gauge
process_windows_working_set
.NetCore下使用Prometheus实现系统监控和警报 (四)客户端代码处理的更多相关文章
- .NetCore下使用Prometheus实现系统监控和警报 (一)介绍【译】
[译]原文https://prometheus.io/docs/introduction/overview 什么是Prometheus? Prometheus是一个开源系统监控和警报工具包,最初起源于 ...
- .NetCore下使用Prometheus实现系统监控和警报 (二)Linux安装
Prometheus对Windows有相关的支持 下载地址:https://prometheus.io/download/ wget https://github.com/prometheus/pr ...
- .NetCore下使用Prometheus实现系统监控和警报 (六)进阶Grafana集成自定义收集指标
Prometheus中包含了很多收集指标,那么我们怎来在Grafana中来使用呢? 接下来我们还是以之前自定义的来演示如图:我们在Prometheus中已经可以看到这个之前我们自定义的类型了 关于Gr ...
- .NetCore下使用Prometheus实现系统监控和警报 (五)进阶自定义收集指标 之 Counter
Prometheus下面定了四种类型的收集方式,下面我们主要来来说下Counter的使用 Nuget导入Prometheus.AspNetCore包 下面先来看下我的Prometheus配置,这里我没 ...
- .NetCore下使用Prometheus实现系统监控和警报 (三)集成Grafana
有了前面InfluxDB的经验,这里就很好处理了,数据类型选择Prometheus选地址等,填好保存 同样通过导入数据处理,我们在https://grafana.com/dashboards上选择Da ...
- go-zero docker-compose 搭建课件服务(七):prometheus+grafana服务监控
0.转载 go-zero docker-compose 搭建课件服务(七):prometheus+grafana服务监控 0.1源码地址 https://github.com/liuyuede123/ ...
- Kubernetes1.16下部署Prometheus+node-exporter+Grafana+AlertManager 监控系统
Prometheus 持久化安装 我们prometheus采用nfs挂载方式来存储数据,同时使用configMap管理配置文件.并且我们将所有的prometheus存储在kube-system #建议 ...
- Prometheus 系统监控方案 一
最近一直在折腾时序类型的数据库,经过一段时间项目应用,觉得十分不错.而Prometheus又是刚刚推出不久的开源方案,中文资料较少,所以打算写一系列应用的实践过程分享一下. Prometheus 是什 ...
- Prometheus 系统监控方案 二 安装与配置
下载Prometheus 下载最新安装包,本文说的都是在Linux x64下面内容,其它平台没尝试过,请选择合适的下载. Prometheus 主程序,主要是负责存储.抓取.聚合.查询方面. Aler ...
随机推荐
- AOP 貌似是拦截器 对方法进行拦截
AOP 貌似是拦截器 对方法进行拦截
- 【bzoj5004】开锁魔法II 组合数学+概率dp
题目描述 有 $n$ 个箱子,每个箱子里有且仅有一把钥匙,每个箱子有且仅有一把钥匙可以将其打开.现在随机打开 $m$ 个箱子,求能够将所有箱子打开的概率. 题解 组合数学+概率dp 题目约定了每个点的 ...
- [代码]--给GridControl中的某列添加图片
要让GridControl的某列显示图片只需要数据源中有图片就可以正确显示 1.给DataSet添加一列,格式为image ds.Tables[].Columns.Add("SIGN&quo ...
- Hello 2018 A,B,C,D
A. Modular Exponentiation time limit per test 1 second memory limit per test 256 megabytes input sta ...
- MT【176】两两乘积
求$1,2\cdots,n$两两乘积的平均值____ 解答:$\dfrac{1}{C_n^2}\sum\limits_{1\le i<j\le n}{ij}=\dfrac{1}{n(n-1)}( ...
- 【bzoj2875】 Noi2012—随机数生成器
http://www.lydsy.com/JudgeOnline/problem.php?id=2875 (题目链接) 题意 求${X_{n}}$. Solution 矩乘板子,这里主要讲下会爆lon ...
- 解题:BZOJ 5093 图的价值
题面 显然只需要考虑一个点(再乘n),那么枚举这个点的度数,另外的$\frac{(n-1)(n-2)}{2}$条边是随意连的,而这个点连出去的边又和其余$n-1$个点产生组合,所以答案就是 $n*\f ...
- 鸟哥的Linux私房菜——第十九章:例行命令的建立
视频链接:http://www.bilibili.com/video/av11008859/ 1. 什么是例行性命令 (分为两种,一种是周期性的,一种是突发性的)1.1 Linux 工作排程的种类: ...
- python---django中自带分页类使用
请先看在学习tornado时,写的自定义分页类:思路一致: python---自定义分页类 1.基础使用: 后台数据获取: from django.core.paginator import Pagi ...
- vue控制台报错
1. TypeError: Cannot read property '_withTask' of undefined 这是因为引用找不到导致的,比如: <button @click='aaa' ...