Metrics Collection Settings
You can customize how MetricsHub collects and processes metrics at different levels: globally, per resource group, or per resource.
Scheduling and Timing
Collection Period
MetricsHub collects metrics every minute by default. Use collectPeriod to change this:
# Global
collectPeriod: 2m
# Per resource
resources:
myHost1:
collectPeriod: 1m30s
Collecting too frequently increases CPU load.
Discovery Cycle
MetricsHub runs discovery every 30 collection cycles by default. Use discoveryCycle to change this:
# Global
discoveryCycle: 15
# Per resource
resources:
myHost1:
discoveryCycle: 5
Running a discovery too frequently increases CPU load.
Duration Format
All timeout and period values support these units:
| Unit | Description | Examples |
|---|---|---|
| s | seconds | 120s |
| m | minutes | 2m, 1m30s |
| h | hours | 1h, 1h30m |
| d | days | 1d |
Filtering
Use monitorFilters to include or exclude specific monitor types and control your telemetry volume:
# Include only specific monitors
monitorFilters: [ +enclosure, +fan, +power_supply ]
# Exclude volumes
monitorFilters: [ "!volume" ]
Critical monitors (batteries, power supplies, CPUs, fans, memory) should never be excluded.
Resource Identity
Custom Hostname
You can differentiate the hostname used for collection from the one reported in metrics:
resources:
myHost1:
attributes:
host.name: reported-hostname # In metrics
protocols:
snmp:
hostname: actual-ip-address # For collection
FQDN Resolution
Set resolveHostnameToFqdn to true to resolve hostnames to fully qualified domain names:
# Global
resolveHostnameToFqdn: true
# Per resource
resources:
myHost1:
resolveHostnameToFqdn: true
Resolution failures may change the host.name attribute and affect metric identity.
Custom Attributes
Add labels to extend the Host Resource attributes:
resources:
myHost1:
attributes:
host.name: my-host-01
host.type: win
app: Jenkins # Custom
environment: prod # Custom
Performance
Parallel Jobs
Use jobPoolSize to control concurrent job execution (default: 20):
jobPoolSize: 40
Too many parallel jobs may cause OutOfMemory errors.
Sequential Mode
Use sequential to force serial execution for sensitive targets:
resources:
myHost1:
sequential: true
Significantly slower. Use only when required by target system limitations.
StateSet Compression
Use stateSetCompression to control how health status metrics are reported:
stateSetCompression: suppressZeros # Default: only report non-zero states
stateSetCompression: none # Report all states
Self-Monitoring
Set enableSelfMonitoring to true to track MetricsHub's own performance:
enableSelfMonitoring: true
When enabled, MetricsHub emits metricshub.job.duration metrics for each job.