Skip to content

Configuration

All options are set via AddHubMon():

csharp
builder.Services.AddHubMon(options =>
{
    // Configure here
});

Required Options

OptionTypeDescription
DashboardUrlstringHubMon API URL (e.g., https://api.hubmon.com)
ApiKeystringYour API key (format: sm_live_...)
ServiceNamestringName of the service (e.g., "payment-api")

Optional Options

OptionTypeDefaultDescription
Environmentstring"production"Environment name (dev, staging, production)
Versionstring?nullService version
Hostnamestring?Auto-detectedMachine hostname
InstanceIdstring?Auto-generatedUnique instance identifier
Portint?Auto-detectedListening port
Urlstring?Auto-detectedFull service URL
HeartbeatIntervalTimeSpan30sHeartbeat frequency (min: 5s)
EnableMetricsboolfalseCollect CPU/Memory/Disk metrics
EnableRequestTrackingboolfalseTrack RPM and active connections
EnableLoggingbooltrueEnable SDK logging
RetryAttemptsint3Retry count for failed requests (0-10)

Deployment Metadata

Track CI/CD information with each registration:

OptionTypeDescription
BuildIdstring?CI build ID (e.g., Azure DevOps)
ReleaseIdstring?Release ID
BuildDateDateTime?When the build was created
DeploymentDateDateTime?When this instance was deployed
CommitHashstring?Git commit hash
Branchstring?Git branch name
BuildConfigurationstring?Build configuration (Release/Debug)
DeploymentMetadataDictionary<string, object>?Custom key-value metadata

Validation Rules

The SDK validates configuration at startup:

  • DashboardUrl must be a valid absolute URL
  • ApiKey cannot be empty
  • ServiceName cannot be empty
  • HeartbeatInterval must be at least 5 seconds
  • RetryAttempts must be between 0 and 10

Invalid configuration throws ArgumentException at startup.

Released under the MIT License.