-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: enable activity polling for more efficient SD refreshes
I added support to ns1-go to list account activity upstream: ns1/ns1-go#233 This adds support for utilizing this endpoint for more efficient service discovery updates. It uses a similar refresh mechanism to what I used when working on linode service discovery for prometheus: https://github.com/prometheus/prometheus/blob/76b0318ed52e655e96a3a4734e3678bf55801616/discovery/linode/linode.go#L183-L231 Rather than refreshing all zone/record cache on every refresh interval, the SD mechanism will now poll the `/account/activity` endpoint. If activity is detected that could affect the zone/record data used to create SD targets, then the SD mechanism will actually go ahead and refresh it's cache. There's a max of 10 polls with no activity detected before refreshing cache regardless of activity status, to ensure that cache is valid/recent.
- Loading branch information
Showing
3 changed files
with
59 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters