Proxy observability updates
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				Build and Publish / release (push) Successful in 2m51s
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	Build and Publish / release (push) Successful in 2m51s
				
			This commit is contained in:
		| @@ -6,6 +6,7 @@ import ( | ||||
| 	"net/url" | ||||
|  | ||||
| 	"github.com/go-resty/resty/v2" | ||||
| 	"github.com/rs/zerolog/log" | ||||
| 	"go.opentelemetry.io/otel/attribute" | ||||
| 	"go.opentelemetry.io/otel/codes" | ||||
| 	"k8s.io/utils/ptr" | ||||
| @@ -40,13 +41,17 @@ func (wu *WUProvider) ProxyReq(ctx context.Context, update *weather.WeatherUpdat | ||||
| 		span.SetStatus(codes.Error, err.Error()) | ||||
| 		span.SetAttributes( | ||||
| 			attribute.String("query", resp.Request.QueryParam.Encode()), | ||||
| 			attribute.String("body", string(resp.Body())), | ||||
| 		) | ||||
| 		span.RecordError(err) | ||||
| 		log.Err(err). | ||||
| 			Int("statusCode", resp.StatusCode()). | ||||
| 			Any("query", resp.Request.PathParams). | ||||
| 			Msg("wunderground proxy failed") | ||||
| 	} | ||||
|  | ||||
| 	span.SetAttributes( | ||||
| 		attribute.Int("statusCode", resp.StatusCode()), | ||||
| 		attribute.String("body", string(resp.Body())), | ||||
| 	) | ||||
|  | ||||
| 	return err | ||||
|   | ||||
		Reference in New Issue
	
	Block a user