@@ -273,6 +273,8 @@ func (c *Client) PostOne(ctx context.Context, record *DeploymentRecord) error {
273273 slog .Debug ("no artifact attestation found, no record created" ,
274274 "attempt" , attempt ,
275275 "status_code" , resp .StatusCode ,
276+ "container_name" , record .Name ,
277+ "digest" , record .Digest ,
276278 )
277279 return & NoArtifactError {err : fmt .Errorf ("no attestation found for %s" , record .Digest )}
278280 case resp .StatusCode >= 400 && resp .StatusCode < 500 :
@@ -284,6 +286,7 @@ func (c *Client) PostOne(ctx context.Context, record *DeploymentRecord) error {
284286 "attempt" , attempt ,
285287 "status_code" , resp .StatusCode ,
286288 "retry_after" , resp .Header .Get ("Retry-After" ),
289+ "container_name" , record .Name ,
287290 "resp_msg" , string (respBody ),
288291 )
289292 lastErr = fmt .Errorf ("rate limited, attempt %d" , attempt )
@@ -294,6 +297,7 @@ func (c *Client) PostOne(ctx context.Context, record *DeploymentRecord) error {
294297 slog .Warn ("client error, aborting" ,
295298 "attempt" , attempt ,
296299 "status_code" , resp .StatusCode ,
300+ "container_name" , record .Name ,
297301 "resp_msg" , string (respBody ),
298302 )
299303 return & ClientError {err : fmt .Errorf ("unexpected client err with status code %d" , resp .StatusCode )}
@@ -303,6 +307,7 @@ func (c *Client) PostOne(ctx context.Context, record *DeploymentRecord) error {
303307 slog .Debug ("retriable error" ,
304308 "attempt" , attempt ,
305309 "status_code" , resp .StatusCode ,
310+ "container_name" , record .Name ,
306311 "resp_msg" , string (respBody ),
307312 )
308313 lastErr = fmt .Errorf ("server error, attempt %d" , attempt )
@@ -312,6 +317,8 @@ func (c *Client) PostOne(ctx context.Context, record *DeploymentRecord) error {
312317 dtmetrics .PostDeploymentRecordHardFail .Inc ()
313318 slog .Error ("all retries exhausted" ,
314319 "count" , c .retries ,
315- "error" , lastErr )
320+ "error" , lastErr ,
321+ "container_name" , record .Name ,
322+ )
316323 return fmt .Errorf ("all retries exhausted: %w" , lastErr )
317324}
0 commit comments