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

pkg/receive: enable forwarding metrics #1243

Merged
merged 3 commits into from
Jun 20, 2019
Merged

Conversation

squat
Copy link
Member

@squat squat commented Jun 11, 2019

This PR enables metrics forwarding from one receive node to another.
The receive nodes construct hashrings from the given sd-files and
use these hashrings to select a node to which to forward a given time
series. Time series are batched together to ensure that for any incoming
write-request to a node, at most one outgoing write-request will be made
every other node in the hashring.

Changes

  • enable time series forwarding between receive nodes

Verification

Added e2e tests for receive nodes in hashring

cc @brancz @bwplotka @metalmatze

cmd/thanos/receive.go Outdated Show resolved Hide resolved
pkg/receive/handler.go Show resolved Hide resolved
pkg/receive/handler.go Show resolved Hide resolved
pkg/receive/handler.go Show resolved Hide resolved
pkg/receive/hashring.go Outdated Show resolved Hide resolved
pkg/receive/handler.go Outdated Show resolved Hide resolved
pkg/receive/hashring.go Outdated Show resolved Hide resolved
pkg/receive/hashring.go Outdated Show resolved Hide resolved
cmd/thanos/receive.go Outdated Show resolved Hide resolved
pkg/receive/hashring.go Outdated Show resolved Hide resolved
This commit renames `host` to `node` in the context of the receive
hashring. This is because more often than not, the hashring will deal
with endpoints rather than simply hosts and node is a more generic
term for the operand of a hashring.
@squat
Copy link
Member Author

squat commented Jun 13, 2019

cc @brancz @metalmatze @bwplotka I addressed the comments you made the first time around so this is now ready for another round 💪

@brancz
Copy link
Member

brancz commented Jun 14, 2019

We had some offline discussion to change this implementation a little bit. The revised version should actually be significantly simpler.

@squat squat force-pushed the forward branch 2 times, most recently from 0c187d6 to 2ae5ba7 Compare June 14, 2019 17:04
@squat
Copy link
Member Author

squat commented Jun 14, 2019

@brancz all the changes we talked about today are in now. The configuration management is much simpler for hashrings now 😌. We have some boilerplate for creating a configuration file watcher, but it is sane and self-contained.

Copy link
Member

@brancz brancz left a comment

Choose a reason for hiding this comment

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

Really nice! It think we're getting close!

pkg/receive/config.go Show resolved Hide resolved
pkg/receive/config.go Outdated Show resolved Hide resolved
pkg/receive/hashring.go Outdated Show resolved Hide resolved
pkg/receive/hashring.go Outdated Show resolved Hide resolved
pkg/receive/hashring.go Outdated Show resolved Hide resolved
@squat squat force-pushed the forward branch 2 times, most recently from 388ffa4 to 251a6da Compare June 17, 2019 14:53
Copy link
Member

@brancz brancz left a comment

Choose a reason for hiding this comment

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

Just the comment about the matcher, and metrics, then this lgtm. Nice work!

pkg/receive/config.go Outdated Show resolved Hide resolved
@squat squat force-pushed the forward branch 2 times, most recently from 4122ee4 to acc7290 Compare June 18, 2019 00:03
pkg/receive/config.go Outdated Show resolved Hide resolved
pkg/receive/hashring.go Outdated Show resolved Hide resolved
This commit enables metrics forwarding from one receive node to another.
The receive nodes construct hashrings from the given sd-files and
use these hashrings to select a node to which toforward a given time
series. Time series are batched together to ensure that for any incoming
write-request to a node, at most one outgoing write-request will be made
every other node in the hashring.
Copy link
Member

@brancz brancz left a comment

Choose a reason for hiding this comment

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

Thanks for bearing with me. This is now significantly simpler and more sound than what we started with. Really happy with the result. Nice job! 👍

@brancz brancz merged commit 34dcf07 into thanos-io:master Jun 20, 2019
@squat squat deleted the forward branch June 20, 2019 12:44
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.

3 participants