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

feat: remote graphite retries #1085

Open
wants to merge 29 commits into
base: master
Choose a base branch
from

Conversation

AleksandrMatsko
Copy link
Member

@AleksandrMatsko AleksandrMatsko commented Sep 19, 2024

Add retry logic for graphite remote

Use exponential backoff retry policy for graphite remote metric source. Retries is configured with special fields

graphite_remote:
  - cluster_id: 
     ...
     # for requests
     timeout: 60s
     # retries configuration for requests, that fetch data
     retries:
         # initial interval for retry attempt
         initial_interval: 60s        
         # used to calc interval between retries: RandomizedRetryInterval = RetryInterval * 
         # * (random value from range [1 - randomization_factor, 1 + randomization_factor]) 
         randomization_factor: 0.5
         # next RetryInterval = RetryInterval * multiplier
         multiplier: 1.5
         # caps RetryInterval (NOT RandomizedRetryInterval)
         max_interval: 120s
         # if already max_retries_count retries performed, stop retrying
         max_retries_count: 3
         # if time passed since first try is more than max_elapsed_time than stop retrying
         max_elapsed_time: 360s
     # for healthcheck requests
     heathcheck_timeout: 60s
     # retries configuration for healthcheck requests
     heathcheck_retries:
         # fields same for retries
         ...

Also added new error: ErrRemoteUnavailable to signal user about graphite unavailability.

script.sh Outdated Show resolved Hide resolved
@AleksandrMatsko AleksandrMatsko marked this pull request as ready for review October 4, 2024 10:44
@AleksandrMatsko AleksandrMatsko requested a review from a team as a code owner October 4, 2024 10:44
clock/clock.go Outdated Show resolved Hide resolved
cmd/config.go Outdated Show resolved Hide resolved
interfaces.go Outdated Show resolved Hide resolved
@AleksandrMatsko AleksandrMatsko marked this pull request as draft October 9, 2024 11:59
@AleksandrMatsko AleksandrMatsko marked this pull request as ready for review October 15, 2024 12:04
@AleksandrMatsko
Copy link
Member Author

/build

Copy link

Build and push Docker images with tag: feat-remote-graphite-retries.2024-10-22.2c87158

return false, err

_, err = remote.makeRequest(req, remote.config.HealthcheckTimeout, remote.healthcheckBackoffFactory.NewBackOff())
err = internalErrToPublicErr(err, "")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тут же ошибки произошло?

мб нэйминг подправить, просто глаз зацепился

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 this pull request may close these issues.

4 participants