MetricsConfig class

Configuration options for telemetry and metrics collection.

Controls what metrics are gathered and how they're exported. Metrics can include system resources, network activity, and storage usage.

Example:

final config = MetricsConfig(
  enabled: true,
  collectionIntervalSeconds: 30,
  enablePrometheusExport: true,
);

Constructors

MetricsConfig({bool enabled = true, int collectionIntervalSeconds = 60, bool collectSystemMetrics = true, bool collectNetworkMetrics = true, bool collectStorageMetrics = true, bool enablePrometheusExport = false, String prometheusEndpoint = '/metrics'})
Creates a metrics configuration with the given options. Creates a new MetricsConfig with the given collection options.
const
MetricsConfig.fromJson(Map<String, dynamic> json)
Creates a MetricsConfig from a JSON map.
factory

Properties

collectionIntervalSeconds int
How often metrics are collected, in seconds.
final
collectNetworkMetrics bool
Whether to collect network bandwidth and peer metrics.
final
collectStorageMetrics bool
Whether to collect disk and block storage metrics.
final
collectSystemMetrics bool
Whether to collect CPU and memory metrics.
final
enabled bool
Whether metrics collection is enabled.
final
enablePrometheusExport bool
Whether to expose metrics via Prometheus endpoint.
final
hashCode int
The hash code for this object.
no setterinherited
prometheusEndpoint String
The HTTP path for Prometheus metrics.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts this configuration to a JSON map.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited