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 监控

上一篇:prometheus-operator笔记


下一篇:Prometheus学习(三)之Prometheus概念:数据模型、metric类型、任务、实例