recordGauge method
Records a gauge metric (current value).
Returns ResultDart with success or TelemetryException on error.
Implementation
@override
Future<ResultDart<void, TelemetryException>> recordGauge({
required String name,
required double value,
Map<String, String> attributes = const {},
}) async {
final metric = Metric(
name: name,
value: value,
unit: 'count',
timestamp: DateTime.now().toUtc(),
attributes: attributes,
);
await _repository.exportMetric(metric);
return const Success(unit);
}