dotnet core 监控

2021/8/7 23:06:43

本文主要是介绍dotnet core 监控,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

 

prometheus-net.DotNetRuntime 获取 CLR 指标原理解析

 

.Net Core服务监控报警指标上报Prometheus+Grafana

https://www.cnblogs.com/linhuiy/p/13157250.html

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{

    app.UseMetricServer();
    
}

  

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
    app.UseMetricServer();
    
    app.UseRouting();
    
    app.UseHttpMetrics();

    app.UseEndpoints(endpoints => { endpoints.MapControllers(); });
}

  

http://localhost:5000/metrics

  配置prometheus.yml http://localhost:9090/targets
  - job_name: 'TEST API'

    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.
    scheme: https
    static_configs:
    - targets: ['localhost:44398']
    tls_config:
      insecure_skip_verify: true

配置grafana

prometheus-net.DotNetRuntime => https://raw.githubusercontent.com/djluck/prometheus-net.DotNetRuntime/master/examples/grafana/provisioning/dashboards/NET_runtime_metrics_dashboard.json   http://localhost:3000/  



这篇关于dotnet core 监控的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程