move enrich span end to defer

This commit is contained in:
Ryan McGuire 2025-03-05 13:04:11 -05:00
parent 29433cddd7
commit 042fd221c4

View File

@ -138,6 +138,8 @@ func (aw *AmbientWeather) enrichUpdate(
// Calculate any fields that may be missing
// such as dew point and wind chill
ctx, enrichSpan := tracer.Start(ctx, p.Name()+".update.enrich")
defer enrichSpan.End()
update.Enrich()
// Enrich station if configured
@ -147,7 +149,6 @@ func (aw *AmbientWeather) enrichUpdate(
update.MapSensors()
enrichSpan.SetStatus(codes.Ok, "")
enrichSpan.End()
}
func (aw *AmbientWeather) proxyUpdate(