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
- 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/