Counters, gauges and histograms, percentiles, RED and USE metrics, System.Diagnostics.Metrics, Prometheus, Grafana and Azure Monitor, cardinality and incident dashboards.
-
Show me how you would add custom business metrics to a .NET 10 service with System.Diagnostics.Metrics: create a Meter, a Counter<T> and a Histogram<T>, choose names, units and tags, export them with OpenTelemetry, and prove in a unit test that they are recorded.
Covers writing custom metrics with Meter, IMeterFactory, Counter<T>, Histogram<T> and ObservableGauge<T>, naming and unit conventions, bounded tags, histogram bucket advice, exporting via OpenTelemetry (OTLP, Azure Monitor, Prometheus) and testing with MetricCollector<T>.
Mid-Level
Coding
Metrics
Β· π 3 follow-ups Β· π 1 real-world
-
Your team runs .NET 10 services on AKS and has to choose between Prometheus with Grafana and Azure Monitor (Application Insights metrics, Azure Monitor managed Prometheus) for metrics. Explain scraping versus pushing, how each stores and queries metrics, how cardinality drives cost in each, and how you would decide.
Covers the pull (Prometheus scrape) and push (OTLP, Azure Monitor exporter) models, self-hosted Prometheus and Grafana versus Azure Monitor managed Prometheus, Azure Managed Grafana and Application Insights metrics, PromQL versus KQL, cardinality limits and cost drivers, and a decision framework.
Mid-Level
Theory
Metrics
Β· π 3 follow-ups Β· π 1 real-world
-
A developer added the user id as a tag on a request metric. A week later Prometheus memory has tripled, dashboards time out, and the managed Prometheus bill has jumped. How do you confirm cardinality is the cause, find the offending metric and label, stop the bleeding, and fix it so it doesn't happen again?
Covers diagnosing a metric cardinality explosion (series counts, top metrics and labels with PromQL, workspace ingestion metrics), immediate mitigation (Collector or relabel drop, SDK views and cardinality limits), the code fix, where per-user data belongs instead, and guardrails.
Senior
Debugging
Metrics
Β· π 3 follow-ups Β· π 1 real-world
-
Your team has forty Grafana dashboards, and during the last outage nobody could tell from them what was broken. Design a service dashboard that on-call engineers actually use during an incident: what goes at the top, how it is laid out, which queries drive it, how it links to traces and logs, and how you keep dashboards from rotting.
Covers designing incident-ready service dashboards: SLO and RED at the top, dependencies and USE below, deploy and change annotations, consistent templates as code, drill-down links to traces and logs, query performance, ownership and review to avoid dashboard sprawl.
Senior
Architecture
Metrics
Β· π 3 follow-ups Β· π 1 real-world
-
What is the difference between a counter, a gauge and a histogram? Give an example of each from a .NET 10 web API, and tell me which metrics ASP.NET Core and the .NET runtime already publish for you before you write any code.
Covers the three core metric instrument types (counter, gauge, histogram), the System.Diagnostics.Metrics instruments that implement them, and the built-in ASP.NET Core, HttpClient and System.Runtime metrics in .NET 10.
Junior
Theory
Metrics
Β· π 3 follow-ups
-
Your dashboard shows an average response time of 120 ms and everyone is happy, but customers say the site is slow. Why are averages misleading for latency? Explain p50, p95, p99 and p99.9, how percentiles are calculated from histograms, and why you can't average percentiles across instances or time windows.
Covers why averages hide tail latency, what p50/p95/p99/p99.9 mean, how percentiles are estimated from histogram buckets, why percentiles cannot be averaged, and how to query them in Prometheus and KQL.
Intermediate
Theory
Metrics
Β· π 3 follow-ups Β· π 1 real-world
-
What are the RED and USE methods? Explain rate, errors and duration, and utilisation, saturation and errors, which one you apply to a service and which to a resource like a database, node or thread pool, and what you would put on the dashboard for a .NET API.
Covers the RED method for request-driven services and the USE method for resources, how they map to built-in .NET and Azure metrics, how they relate to Google's four golden signals, and how to use them to structure dashboards and triage.
Intermediate
Theory
Metrics
Β· π 3 follow-ups Β· π 1 real-world