Skip to content

Getting Started

Installation

Install the HubMon SDK via NuGet:

bash
dotnet add package HubMon.Client

Quick Start

Add HubMon to your ASP.NET Core application:

csharp
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:

  1. Register with HubMon on startup
  2. Send heartbeats every 30 seconds
  3. Report metrics — CPU, memory, disk, and thread count

Getting Your API Key

  1. Sign up at HubMon
  2. Navigate to API Keys in your dashboard
  3. Click Create New Key
  4. Copy the key (starts with sm_live_)

WARNING

The API key is shown only once — save it securely!

Enable Request Tracking

For web applications, you can also track requests per minute and active connections:

csharp
builder.Services.AddHubMon(options =>
{
    // ...
    options.EnableRequestTracking = true;
});

var app = builder.Build();
app.UseHubMonTracking();  // Add before other middleware
app.Run();

Next Steps

Released under the MIT License.