在代码中使用就比较简单了

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实现系统监控和警报 (四)客户端代码处理的更多相关文章

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

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

  2. .NetCore下使用Prometheus实现系统监控和警报 (二)Linux安装

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

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

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

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

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

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

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

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

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

  7. Kubernetes1.16下部署Prometheus+node-exporter+Grafana+AlertManager 监控系统

    Prometheus 持久化安装 我们prometheus采用nfs挂载方式来存储数据,同时使用configMap管理配置文件.并且我们将所有的prometheus存储在kube-system #建议 ...

  8. Prometheus 系统监控方案 一

    最近一直在折腾时序类型的数据库,经过一段时间项目应用,觉得十分不错.而Prometheus又是刚刚推出不久的开源方案,中文资料较少,所以打算写一系列应用的实践过程分享一下. Prometheus 是什 ...

  9. Prometheus 系统监控方案 二 安装与配置

    下载Prometheus 下载最新安装包,本文说的都是在Linux x64下面内容,其它平台没尝试过,请选择合适的下载. Prometheus 主程序,主要是负责存储.抓取.聚合.查询方面. Aler ...

随机推荐

  1. 一本通1645Fibonacci

    1645:Fibonacci 时间限制: 1000 ms         内存限制: 524288 KB [题目描述] 原题来自:POJ 3070 我们知道斐波那契数列 F0=0,F1=1,Fn=Fn ...

  2. Django时间时区问题(received a naive datetime while time zone support is active)

    在django1.4以后,存在两个概念 naive time 与 active time. 简单点讲,naive time就是不带时区的时间,Active time就是带时区的时间. 举例来说,使用d ...

  3. 51nod 1295 XOR key (可持久化Trie树)

    1295 XOR key  题目来源: HackerRank 基准时间限制:1.5 秒 空间限制:262144 KB 分值: 160 难度:6级算法题   给出一个长度为N的正整数数组A,再给出Q个查 ...

  4. Gym 100463A Crossings (树状数组 逆序对)

    Crossings Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100463 Description ...

  5. CodeForces - 707C

    C. Pythagorean Triples time limit per test 1 second memory limit per test 256 megabytes input standa ...

  6. 【BZOJ1032】[JSOI2007]祖玛(动态规划)

    [BZOJ1032][JSOI2007]祖玛(动态规划) 题面 BZOJ 洛谷 题解 听说是道假题,假的原因是因为出题人可能没有考虑到祖玛的骚套路,比如可以先打几个球进去再一波消掉.也就是出题人基本默 ...

  7. 动态生成web表-asp.net table

    1. 页面上定义一个server 的table <table style="width: 100%" id="tbContent" runat=" ...

  8. 【转】汽车CAN总线

    概述 CAN(Controller Area Network)总线协议是由 BOSCH 发明的一种基于消息广播模式的串行通信总线,它起初用于实现汽车内ECU之间可靠的通信,后因其简单实用可靠等特点,而 ...

  9. .net 里面打不出来ConfigurationManager

    ConfigurationManager 这个东东是读取配置文件时需要的. 首先要引用命名空间里面 using System.Configuration; 其次呢,在解决方案的引用里,单机右键进行添加

  10. 给radio加自己的样式(图片)

    $('.choice').click(function() { var display1 = $("#check").prop("checked"); cons ...