move enrich span end to defer
This commit is contained in:
		| @@ -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( | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user