diff --git a/main.go b/main.go index 6767994..58fcda8 100644 --- a/main.go +++ b/main.go @@ -63,11 +63,9 @@ func buildFrameTags(f teleinfo.Frame) []string { } func exportFrames(dsd *statsd.Client, framesChan chan teleinfo.Frame) { - counters := map[string]string{ + gauges := map[string]string{ "HCHC": "counter_low_price_kwh", "HCHP": "counter_full_price_kwh", - } - gauges := map[string]string{ "PAPP": "power_va", "IINST": "current_amps", } @@ -78,17 +76,6 @@ func exportFrames(dsd *statsd.Client, framesChan chan teleinfo.Frame) { continue } - for key, metric := range counters { - value, ok := f.GetUIntField(key) - if !ok { - s, _ := f.GetStringField(key) - log.WithFields(log.Fields{"field_name": key, "field_value": s, "metric": metric}).Warn("Cannot extract metric value from frame") - continue - } - log.WithFields(log.Fields{"value": value, "metric": metric, "namespace": dsd.Namespace, "tags": tags}).Debug("Sending dogstatsd counter") - dsd.Count(metric, int64(value), tags, 1) - } - for key, metric := range gauges { value, ok := f.GetUIntField(key) if !ok {