Create a Custom Prometheus .NET Meter

In a previous post I showed you how to add Prometheus metrics to a Blazor app on Fly.io using the OpenTelemetry NuGet packages. Fly makes capturing and displaying metrics simple with their built in Grafana dashboards. But sometimes there are events and metrics from the application layer that you’d like to track, such as how many views a particular piece of content got. Here I’ve created InstrumentationService.cs which I can easily inject into any Blazor component in order to increment a counter:...

August 25, 2024 · 2 min · 357 words · Me ·