Skip to content

Find a way to fetch the number of attempt #352

@christophe-dufour

Description

@christophe-dufour

Retry comes with a nice retry system.
For monitoring reason, I would like to be able when I get a response, how many attempts Resty has to do to complete the request.

Something like that:

client := resty.New()SetRetryCount(3).OnAfterResponse(func(c *resty.Client, resp *resty.Response) error {
			metrics.ReportHTTPCall(resp.StatusCode(),resp.Request.Method, somewhere.NumberOfAttempt())
			return nil
		})

Is there a way to get that value?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions