From ecdac2087217684c7d8e309e1f8fce7099393c51 Mon Sep 17 00:00:00 2001 From: awaescher Date: Wed, 15 May 2024 20:53:02 +0200 Subject: [PATCH] Use Gauge.Set() instead of IncTo() coming from counters --- MaxPower/HostedServices/ExporterService.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MaxPower/HostedServices/ExporterService.cs b/MaxPower/HostedServices/ExporterService.cs index a1db46d..8330f65 100644 --- a/MaxPower/HostedServices/ExporterService.cs +++ b/MaxPower/HostedServices/ExporterService.cs @@ -30,10 +30,10 @@ protected override async Task ExecuteAsync(CancellationToken cancellationToken) var data = await MaxTalkClient.RequestAsync(inverter.Ip, inverter.Id, inverter.Port); string[] labels = [inverter.Ip, inverter.Id.ToString()]; - _energyDay.WithLabels(labels).IncTo(data.EnergyDay); - _energyMonth.WithLabels(labels).IncTo(data.EnergyMonth); - _energyYear.WithLabels(labels).IncTo(data.EnergyYear); - _energyTotal.WithLabels(labels).IncTo(data.EnergyTotal); + _energyDay.WithLabels(labels).Set(data.EnergyDay); + _energyMonth.WithLabels(labels).Set(data.EnergyMonth); + _energyYear.WithLabels(labels).Set(data.EnergyYear); + _energyTotal.WithLabels(labels).Set(data.EnergyTotal); } catch (Exception ex) {