move enrich span end to defer
This commit is contained in:
parent
29433cddd7
commit
042fd221c4
@ -138,6 +138,8 @@ func (aw *AmbientWeather) enrichUpdate(
|
|||||||
// Calculate any fields that may be missing
|
// Calculate any fields that may be missing
|
||||||
// such as dew point and wind chill
|
// such as dew point and wind chill
|
||||||
ctx, enrichSpan := tracer.Start(ctx, p.Name()+".update.enrich")
|
ctx, enrichSpan := tracer.Start(ctx, p.Name()+".update.enrich")
|
||||||
|
defer enrichSpan.End()
|
||||||
|
|
||||||
update.Enrich()
|
update.Enrich()
|
||||||
|
|
||||||
// Enrich station if configured
|
// Enrich station if configured
|
||||||
@ -147,7 +149,6 @@ func (aw *AmbientWeather) enrichUpdate(
|
|||||||
update.MapSensors()
|
update.MapSensors()
|
||||||
|
|
||||||
enrichSpan.SetStatus(codes.Ok, "")
|
enrichSpan.SetStatus(codes.Ok, "")
|
||||||
enrichSpan.End()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (aw *AmbientWeather) proxyUpdate(
|
func (aw *AmbientWeather) proxyUpdate(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user