As part of your monitoring infrastructure, you need to expose custom metrics, directly from your application, which provides additional instrumentation and insights into your business logic. The most popular programming languages have bindings for Prometheus—for C#, one of the libraries that provides integration with Prometheus is prometheus-net (https://github.com/prometheus-net/prometheus-net). You can use it with the classic .NET Framework and .NET Core as it is targeting .NET Standard 2.0. The features include the following:
- Exporting counters and gauges
- Measuring operation duration and creating a summary or histogram
- Tracking in-progress operations and creating gauges with the number of concurrently executed code blocks
- Exception counting
Additionally, for ASP.NET Core applications, you can use a dedicated middleware...