Skip to content

Comments

ASP.NET Metrics Dashboard for SigNoz Integration#100

Open
karanveersingh5623 wants to merge 2 commits intoSigNoz:mainfrom
karanveersingh5623:add-aspnet-dashboard-oltp-v1
Open

ASP.NET Metrics Dashboard for SigNoz Integration#100
karanveersingh5623 wants to merge 2 commits intoSigNoz:mainfrom
karanveersingh5623:add-aspnet-dashboard-oltp-v1

Conversation

@karanveersingh5623
Copy link

@karanveersingh5623 karanveersingh5623 commented Oct 28, 2024

SigNoz/signoz#5996
/claim SigNoz/signoz#5996
Add aspnet dashboard - oltp, v1

ASP.NET Metrics Dashboard for SigNoz Integration

Description:

This PR introduces an ASP.NET metrics dashboard with integrated OpenTelemetry (OTel) instrumentation to monitor application performance and telemetry data sent to SigNoz. Key features include:

1. Telemetry Data Collection

  • Utilizes OpenTelemetry packages for ASP.NET, process, runtime, and core instrumentation to gather metrics and traces, which are then exported to SigNoz.

2. OTLP Configuration

  • Configures OTLP (OpenTelemetry Protocol) for data ingestion using gRPC and HTTP receivers on ports 4317 and 4318, allowing compatibility with various communication protocols.

3. Exporting Data to SigNoz

  • Sets up OTLP exporter to forward collected telemetry data, including process-level metrics (CPU, memory) and application-specific metrics (latency, error rates), to SigNoz, with environment-specific configurations.

4. Dashboard Panels:

  • Application Performance:
    • CPU and memory usage, request rate, and response times.
  • Request and Response Behavior:
    • Tracks request latency, error rates, and active requests.

5. Environment and Resource Attributes:

  • Identifies application environment (Staging/Production) for filtered monitoring in the SigNoz dashboard.

This integration enhances observability by automating metrics and trace collection and centralizing insights into the ASP.NET application's performance.

@makeavish
Copy link
Member

Can you please add the service.name as well?
Also any specific reason to use manual instrumentation, zero code instrumentation should also work

@karanveersingh5623
Copy link
Author

@makeavish

For the service.name, I added a new environment variable for the service name. Users can filter the metrics based on the service name. I'm not sure if this update fulfills the requirement or not.

for zero-code instrumentation it didn't work as expected. It seems like the collected data was not accurate.
Zero-code instrumentation is fast and easy to set up, but in our use case, it didn't collect the metrics that I want to build a dashboard on. So, manual instrumentation is needed.

The attached image shows the list of metrics that we can use to monitor our application. The documentation of each library contains the manual setup for the app. So basically, we need to add more code to get the metrics that we want.
https://opentelemetry.io/docs/zero-code/net/instrumentations/#metrics-instrumentations

Let me know if I am missing something

@makeavish
Copy link
Member

In most of the panels service.name filter is missing in WHERE clause

Also in below panel y-axis unit might be wrong, I think it's bytes
Screenshot 2024-11-27 at 17 39 32

CPU Usage panel query seems to be incorrect.

Unit of Processors panel seems to be wrong
Screenshot 2024-11-27 at 17 48 19

Error rate query is incorrect
Screenshot 2024-11-27 at 17 57 25

Request rate query is also incorrect
Screenshot 2024-11-27 at 17 58 23

Suggest you to read this doc before fixing: https://signoz.io/docs/metrics-management/types-and-aggregation/?utm_source=product&utm_medium=query-builder#histogram--exponential-histogram

@karanveersingh5623
Copy link
Author

@makeavish

I tried to get the CPU usage but it seemed to not have the available metrics for it. So I switched to total CPU time for different states.

image

For the Unit of Processors panel, I changed the aggregate operator to "Count". According to the docs, the Count operator will give us a number of something so it will fit well for displaying the number of processors

image

For the error rate and request rate, the metric that I use ishttp_server_request_duration_countwhich is the only available metric to track the number of requests. I also switch to the "increase" operator, which will give us the total number of events. for example, I simulated the 404 error response code by sending a request 1000 times per second and it gave back a correct number.
image
image

@itsurge
Copy link

itsurge commented Nov 24, 2025

.NET 8 ASP.NET Core Metrics Dashboard for SigNoz

Overview

This dashboard provides comprehensive monitoring and observability for ASP.NET Core applications running on .NET 8 with OpenTelemetry instrumentation integrated into SigNoz. It automatically collects and visualizes key application metrics without requiring additional code changes to your application.

Features

 Real-time HTTP Server Monitoring

  • Request latency percentiles (p50, p90, p99) for performance analysis
  • Request throughput (RPS) tracking and spike detection
  • Active HTTP request monitoring
  • Status code distribution and error rate tracking
  • Kestrel server connection metrics (active/queued)

 Runtime & Memory Management

  • GC Heap size tracking and memory fragmentation analysis
  • Committed memory size monitoring
  • Physical memory usage per process
  • Garbage collection rate and frequency analysis

 Thread Pool & Performance Optimization

  • Active thread count and state analysis
  • Thread pool queue length for bottleneck detection
  • CPU time allocation by state (user/kernel/idle)
  • Lock contention rate monitoring for concurrency issues

 Error & Diagnostics

  • ASP.NET Core exception rate tracking with thresholds
  • Exception type and frequency analysis
  • Lock contention monitoring for performance degradation

Metrics Covered

Category | Metric | Unit -- | -- | -- HTTP Server | http.server.request.duration.bucket | seconds   | http.server.request.duration.count | requests   | http.server.active_requests | count Runtime | process.runtime.dotnet.gc.heap.size | bytes   | process.runtime.dotnet.gc.committed_memory.size | bytes   | process.memory.usage | bytes Thread Pool | process.runtime.dotnet.thread_pool.threads.count | count   | process.runtime.dotnet.thread_pool.queue.length | count Performance | process.cpu.time | seconds   | process.runtime.dotnet.monitor.lock_contention.count | count Connections | kestrel.active_connections | connections   | kestrel.queued_connections | connections Diagnostics | aspnetcore.diagnostics.exceptions | exceptions

Dashboard Structure

  1. Application Performance (4 panels)

    • HTTP Request Latency
    • Request Rate
    • Active HTTP Requests
    • Request Throughput
  2. Runtime & Memory (4 panels)

    • GC Heap Size
    • GC Committed Memory
    • Physical Memory Usage
    • GC Collections Rate
  3. Thread Pool & Performance (3 panels)

    • Thread Pool Threads Count
    • Thread Pool Queue Length
    • CPU Time by State
  4. Connections & Errors (3 panels)

    • Kestrel Connections Status
    • ASP.NET Exceptions Rate (with alerts)
    • Lock Contention Rate

How to Use

  1. Prerequisites

    • ASP.NET Core .NET 8 application
    • OpenTelemetry SDK configured with OTLP exporter
    • SigNoz instance running (with OTLP receiver enabled)
  2. Installation

    • Copy the dashboard JSON to SigNoz
    • Import via Dashboard > New > Import
    • Select service and environment from dropdown filters
  3. Configuration

    plaintextCopy
    Deployment Environment: Select (Staging/Production)
    Service Name: Select your service
    

Key Metrics Explained

  • Latency Percentiles: Track p50, p90, p99 to understand user experience across the distribution
  • Active Requests: Monitor concurrent requests to detect throughput bottlenecks
  • GC Metrics: Monitor garbage collection efficiency and memory pressure
  • Thread Pool: Detect thread starvation and queue buildup issues
  • CPU Time: Analyze CPU usage patterns by state
  • Exception Rate: Set thresholds to alert on error spikes

Requirements

  • SigNoz v0.24.0+
  • OpenTelemetry .NET SDK v1.4.0+
  • ASP.NET Core .NET 8

NET 8 ASP.NET Metrics Dashboard.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants