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

add aggregated-consistent-hashing relay rule #32

Merged
merged 2 commits into from
Aug 30, 2012

Conversation

slackhappy
Copy link
Contributor

This change adds a new type of relay rule which determines the appropriate destination for a metric by first applying the aggregation rules specified in aggregation-rules.conf, then applying consistent hashing on any resulting aggregated metric paths (or the original, if nothing matches).

The change is designed to address this type of problem:
https://answers.launchpad.net/graphite/+question/187874

But, without having to hand-convert the aggregation-rules into evenly distributed relay rules. With this change, pointing the relay at the aggregation-rules is sufficient.

I have tested that this also works for non-aggregated metrics, which will pass through the aggregator.

Here is a sample topology that would be enabled:
Sample Topologyt

To use, in the [relay] section, set
RELAY_METHOD = aggregated-consistent-hashing

@travisbot
Copy link

This pull request passes (merged f44aa96 into 32989f7).

@travisbot
Copy link

This pull request fails (merged a16f2e7 into 32989f7).

@slackhappy
Copy link
Contributor Author

Hrm. Travis says: executing your install (pip install -r requirements.txt --use-mirrors) took longer than 15 minutes and was terminated. Not sure how to make it retry.

mleinart added a commit that referenced this pull request Aug 30, 2012
@mleinart mleinart merged commit a16f2e7 into graphite-project:master Aug 30, 2012
mleinart added a commit that referenced this pull request Aug 30, 2012
@mleinart
Copy link
Member

This is pretty cool and does solve a frustrating problem when using aggregator.

There is an edge case when a metric matches multiple rules and will end up as several aggregate metric names. In this case the metric will (potentially) be duplicated to multiple aggregator daemons, each creating the proper aggregated metric. Aggregator does however pass through the original metric as well which means that this metric will ultimately end up being sent more than once to some downstream carbon daemon.

That said, I dont find that case especially concerning as a carbon-cache when it receives a duplicate point will ultimately discard it.

I've committed this and will update the conf file examples with a description.

Thanks!

@slackhappy
Copy link
Contributor Author

Thanks for the merge! Yeah, I was relying on the duplicate point behavior to do the right thing, thanks for calling that out. In our case, we actually are discarding the original metric if it matches at least one aggregation rule.

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.

None yet

3 participants