code tweaks
All checks were successful
Build and Publish / release (push) Has been skipped
Build and Publish / check-chart (push) Successful in 10s
Build and Publish / helm-release (push) Has been skipped

This commit is contained in:
Ryan McGuire 2025-04-03 10:44:43 -04:00
parent 2f83edc426
commit 268bc7d8a2

View File

@ -3,6 +3,7 @@ package weather
import (
"context"
"errors"
"slices"
"github.com/rs/zerolog"
"go.opentelemetry.io/otel/attribute"
@ -64,20 +65,10 @@ func (r *MetricRecorder) Record(opts *RecordOpts) {
func (o *RecordOpts) keep() bool {
// If keep fields are given, only check keep fields
if len(o.Station.KeepMetrics) > 0 {
for _, f := range o.Station.KeepMetrics {
if f == o.Field {
return true
}
}
return false
return slices.Contains(o.Station.KeepMetrics, o.Field)
}
for _, f := range o.Station.DropMetrics {
if f == o.Field {
return false
}
}
return true
return !slices.Contains(o.Station.DropMetrics, o.Field)
}
func (r *MetricRecorder) recordInt(