HubMon.Client
1.2.0
dotnet add package HubMon.Client --version 1.2.0
NuGet\Install-Package HubMon.Client -Version 1.2.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="HubMon.Client" Version="1.2.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="HubMon.Client" Version="1.2.0" />
<PackageReference Include="HubMon.Client" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add HubMon.Client --version 1.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: HubMon.Client, 1.2.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package HubMon.Client@1.2.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=HubMon.Client&version=1.2.0
#tool nuget:?package=HubMon.Client&version=1.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
HubMon.Client
Official .NET client SDK for the HubMon service monitoring platform. Automatically registers your service and sends periodic heartbeats with system metrics.
Current version:
1.2.0— View on NuGet
Features
- Easy Integration — Add monitoring with just 3 lines of code
- System Metrics — CPU, memory, disk usage, thread count
- Request Tracking — Requests/min and active connections via middleware
- Auto-Retry — Built-in retry logic with exponential backoff
- Deployment Metadata — Track builds, commits, and releases
- Lightweight — Minimal overhead on your application
Installation
dotnet add package HubMon.Client
Quick Start
using ServiceMonitor.Client;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddHubMon(options =>
{
options.DashboardUrl = "https://api.hubmon.com";
options.ApiKey = "sm_live_your_api_key_here";
options.ServiceName = "my-api";
options.Environment = "production";
options.EnableMetrics = true;
});
var app = builder.Build();
app.Run();
That's it! Your service will automatically:
- Register with HubMon on startup
- Send heartbeats every 30 seconds
- Report CPU, memory, disk, and thread metrics
Request Tracking
Track HTTP requests per minute and active connections:
builder.Services.AddHubMon(options =>
{
options.DashboardUrl = "https://api.hubmon.com";
options.ApiKey = "sm_live_...";
options.ServiceName = "my-api";
options.EnableMetrics = true;
options.EnableRequestTracking = true;
});
var app = builder.Build();
app.UseHubMonTracking(); // Add tracking middleware
app.Run();
Configuration
builder.Services.AddHubMon(options =>
{
// Required
options.DashboardUrl = "https://api.hubmon.com";
options.ApiKey = "sm_live_...";
options.ServiceName = "my-service";
// Optional
options.Environment = "production"; // Default: "production"
options.Version = "1.0.0";
options.HeartbeatInterval = TimeSpan.FromSeconds(30); // Default: 30s, min: 5s
options.EnableMetrics = true; // CPU/Memory/Disk (default: false)
options.EnableRequestTracking = true; // RPM/Connections (default: false)
options.EnableLogging = true; // Default: true
options.RetryAttempts = 3; // Default: 3, range: 0-10
// Deployment metadata (CI/CD)
options.CommitHash = "a1b2c3d";
options.Branch = "main";
options.BuildConfiguration = "Release";
});
Using appsettings.json
{
"HubMon": {
"DashboardUrl": "https://api.hubmon.com",
"ApiKey": "sm_live_your_api_key",
"ServiceName": "my-service",
"Environment": "production",
"EnableMetrics": true,
"EnableRequestTracking": true
}
}
builder.Services.AddHubMon(options =>
{
builder.Configuration.GetSection("HubMon").Bind(options);
});
Metrics
When EnableMetrics = true:
| Metric | Description |
|---|---|
| CPU Usage | Process CPU percentage |
| Memory | Working set in MB |
| Total Memory | Available system memory in MB |
| Disk Usage | Root drive usage percentage |
| Thread Count | Active thread count |
When EnableRequestTracking = true:
| Metric | Description |
|---|---|
| Requests/Min | HTTP requests per minute |
| Active Connections | Current concurrent connections |
Worker Service
using ServiceMonitor.Client;
var builder = Host.CreateApplicationBuilder(args);
builder.Services.AddHubMon(options =>
{
options.DashboardUrl = "https://api.hubmon.com";
options.ApiKey = "sm_live_...";
options.ServiceName = "background-worker";
options.EnableMetrics = true;
options.HeartbeatInterval = TimeSpan.FromMinutes(1);
});
builder.Services.AddHostedService<Worker>();
var host = builder.Build();
host.Run();
Requirements
- .NET 8.0 or higher
- HubMon account with API key
Documentation
Full documentation: https://gethubmon.github.io/hubmon-dotnet
License
MIT License — see LICENSE for details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Http (>= 8.0.0)
- Microsoft.Extensions.Options (>= 8.0.0)
-
net9.0
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Http (>= 8.0.0)
- Microsoft.Extensions.Options (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.2.0 | 108 | 4/6/2026 |
| 1.0.0 | 111 | 4/6/2026 |
| 1.0.0-alpha.1 | 64 | 4/2/2026 |