iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
To monitor an ASP.NET Core service in real time, collect its built-in and application-specific metrics with OpenTelemetry, send them to a time-series backend, and use Grafana to query, visualize, and alert on them. The most directly documented OpenTelemetry route uses a Prometheus exporter and Prometheus storage. If you choose InfluxDB instead, configure an explicit exporter or collector bridge; the Microsoft sample does not write directly to InfluxDB.
How the monitoring pipeline fits together
Metrics are numerical measurements reported over time. Monitoring turns those measurements into a cycle: instrument the application, collect and store measurements, visualize them, alert when thresholds are crossed, and analyze trends.
A practical pipeline is:
ASP.NET Core and custom meters → OpenTelemetry SDK/exporter → Prometheus scrape endpoint or collector → Prometheus or InfluxDB → Grafana dashboards and alerts
Recommended Free Tools
Grafana is the visualization and alerting layer; it queries data stored in a compatible backend. For a Prometheus setup, Prometheus scrapes the OpenTelemetry metrics endpoint. For an InfluxDB setup, make the route from OpenTelemetry to InfluxDB explicit through the chosen exporter or collector configuration, then configure Grafana to query that InfluxDB instance.
#1 Best Overall
The current documentation calls the web framework ASP.NET Core. The title’s “.NET Core” wording is commonly used for this monitoring topic, but the package and API details depend on the application’s .NET and ASP.NET Core versions; no version-specific setup is established here.
Choose Prometheus or InfluxDB as the metrics store
The shortest documented OpenTelemetry route and a stack that already standardizes on InfluxDB are different deployment choices. Choose based on the exporter path and the operational model your team can support, rather than assuming either database is interchangeable at every step.
| Decision point | Prometheus | InfluxDB |
|---|---|---|
| Documented route from OpenTelemetry .NET | The OpenTelemetry ASP.NET Core guidance shows a Prometheus exporter exposing an endpoint for Prometheus to scrape. | Use an explicitly configured exporter or collector bridge. The Microsoft sample does not send directly to InfluxDB. |
| Grafana connection | Configure Grafana with a Prometheus data source. | Grafana supports InfluxDB as a data source. Select the query language for the InfluxDB version in use, such as Flux or InfluxQL. |
| Access needed by Grafana | Not stated in the cited documentation for this comparison. | Grant Grafana’s token read access to the relevant data. |
| Query language, retention, and downsampling trade-offs | Not stated in the cited documentation for this comparison. | Not stated in the cited documentation for this comparison. |
| Cardinality behavior, backup and restore, and operational ownership | Not stated in the cited documentation for this comparison. | Not stated in the cited documentation for this comparison. |
InfluxData describes InfluxDB as optimized for storing and retrieving time-series data used in operations monitoring, application metrics, IoT, and real-time analytics. That suitability does not remove the need to choose and maintain the ingestion bridge, query language, access controls, and retention policy for a particular deployment.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Instrument the ASP.NET Core service
Start with framework and server measurements
Microsoft’s ASP.NET Core metrics guidance includes http.server.request.duration, kestrel.active_connections, signalr.server.active_connections, and aspnetcore.diagnostics.exceptions. Its sample registers the Microsoft.AspNetCore.Hosting and Microsoft.AspNetCore.Server.Kestrel meters and explicitly configures a histogram for http.server.request.duration.
Rank #2
For a service that does not use SignalR, omit that meter from dashboards unless it is relevant to the application. Likewise, add measurements for components the service actually runs; collected metrics are useful only when their meaning is understood.
Add measurements for work the framework cannot describe
Use a named application meter for business and dependency behavior that built-in instruments do not capture. Examples include:
- Queue depth: a gauge-like measurement of work waiting to be processed.
- Dependency latency: a histogram for calls to databases or other services.
- Cache hit rate: counters for hits and misses, from which a rate can be calculated.
- Job duration: a histogram for background or scheduled work.
Keep metric labels bounded. Labels with a new value for every user, request, URL, or other unbounded identifier can multiply time-series and storage growth. Prefer a small set of stable categories that lets an operator distinguish useful cases without turning each event into a separate series.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitchesImplement the collection path
- Add OpenTelemetry hosting and metrics packages to the ASP.NET Core project that match its target framework and chosen exporter path.
- Register the framework meters for ASP.NET Core hosting and Kestrel, and register a named meter for the application’s own instruments. Configure the request-duration histogram explicitly, following the Microsoft metrics sample for the project’s version.
- Instrument business operations and dependencies. Add counters and histograms for the selected application measurements, and ensure their labels stay bounded.
- Choose how metrics leave the process. For the directly documented path, expose the OpenTelemetry Prometheus exporter endpoint for Prometheus to scrape. Alternatively, send OTLP to a collector and configure its onward route to the selected backend.
- Configure the backend and Grafana data source. Use Prometheus with Prometheus storage, or configure the exporter/collector bridge to InfluxDB and set Grafana’s InfluxDB query language and read credentials.
- Build dashboards and alerts around the service’s traffic, latency, failures, active connections, resource use, and saturation. Confirm that measurements arrive and that labels and retention behave as intended.
The precise package versions, exporter configuration, endpoint path, and collector configuration are not specified here; use the documentation for the application’s target framework and selected exporter rather than copying settings meant for a different version.
Rank #3
Run the stack with Docker Compose
InfluxData documents a Docker Compose initialization flow for InfluxDB v2. The documented setup uses initialization settings for a username, password, organization, bucket, and administrator token. Docker Desktop is listed as a prerequisite for that Compose setup.
Plan the services and persistent data
Keep the application, collector if used, time-series database, and Grafana on a private Compose network so the services can communicate without making every service public. Persist the InfluxDB data directory in a volume so container replacement does not discard the database. Add health checks so dependent services can distinguish a running container from a ready service.
Protect credentials and the Docker API
- Supply database credentials and tokens through Compose secrets or another secret-management mechanism; do not commit tokens in a Compose file.
- Give Grafana only the read access it needs for the InfluxDB bucket or data it will query.
- Publish only the ports required for operator access or scraping. Keep internal service traffic on the private network.
- If using the Docker input plugin to collect container state and resource metrics, restrict access to the Docker Engine API and protect the Docker socket. Access to that socket is a sensitive control surface.
InfluxData also documents a Docker input plugin that reads container state and resource metrics through the Docker Engine API and sends them toward Grafana dashboards. Container metrics complement application instrumentation; they do not replace request-duration, error, or business-operation measurements from the ASP.NET Core service.
No image tags, port mappings, or complete Compose manifest are specified here. Those values should be selected for the versions and exposure model of the deployment rather than treated as universal defaults.
Rank #4
Build dashboards and alerts that answer operational questions
Organize a service dashboard so an operator can move from symptoms to likely causes. The implementation outline calls for throughput, p50/p95/p99 latency, errors, active connections, CPU, memory, and saturation. Use request rate and error measurements to see whether traffic or failures changed; latency percentiles help show slow requests that an average can conceal; connection and resource views add context about capacity.
Set alert thresholds from the service’s objectives rather than adopting a number without context. Microsoft’s ASP.NET Core metrics documentation gives a 400 ms response objective and a 600 ms observed response as an example of a condition that could notify operations staff; those are illustrative values, not a benchmark or recommended threshold for every application.
After creating alerts, verify that the chosen measurements and labels appear as expected, that the backend’s retention policy supports the trends operators need, and that data remains available after a service or container restart. These checks catch gaps between a dashboard that renders and a monitoring system that is dependable during an incident.
What this setup does—and does not—establish
The Microsoft and OpenTelemetry documentation support the instrumentation and Prometheus-exporter path described above, while Grafana and InfluxData document InfluxDB as a time-series data source and Docker deployment option. They do not establish a measured performance improvement, a benchmark, or a single best retention, scaling, or backup policy for every .NET application. Those choices depend on workload, data volume, deployment constraints, and the team responsible for operating the stack.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

