Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log automatic retries from SDK #55

Open
jkroepke opened this issue Jul 8, 2023 · 3 comments · May be fixed by #56
Open

Log automatic retries from SDK #55

jkroepke opened this issue Jul 8, 2023 · 3 comments · May be fixed by #56

Comments

@jkroepke
Copy link
Contributor

jkroepke commented Jul 8, 2023

Hi,

we guess, we are hitting sometimes rate-limits from Azure. Since the SDK has automatic retries enabled, we are getting sometime the error context deadline exceeded, since the request took longer than the configured scrapeInterval.

Is it possible to log an warning, if a retry appears? Logging the response, which reason we are getting for the 429 would be awesome to identity the root cause.

@jkroepke
Copy link
Contributor Author

jkroepke commented Jul 8, 2023

It should be something like this?

https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/azidentity/README.md#logging

import azlog "github.com/Azure/azure-sdk-for-go/sdk/azcore/log"


azlog.SetEvents(log.EventRetryPolicy)
azlog.SetListener(func(cls azlog.Event, msg string) {
	if cls == azlog.EventRetryPolicy {
		// suggar logger
        logger.Warnln(err)
	}
})

@jkroepke jkroepke linked a pull request Jul 8, 2023 that will close this issue
@Neurobion
Copy link

Neurobion commented Apr 30, 2024

Hi,

we guess, we are hitting sometimes rate-limits from Azure. Since the SDK has automatic retries enabled, we are getting sometime the error context deadline exceeded, since the request took longer than the configured scrapeInterval.

Is it possible to log an warning, if a retry appears? Logging the response, which reason we are getting for the 429 would be awesome to identity the root cause.

I'm not sure if the error context deadline exceeded means a problem with limits. I have set only one resource and one metric and it keeps returning this error.
https://gosamples.dev/context-deadline-exceeded/

test.json

@Neurobion
Copy link

Can you take a look at this, please? It's acting strange.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants