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

Graphite backend: Applying the globalPrefix value in legacyNamespace mode #405

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

derpston
Copy link

It's useful to be able to specify a prefix for everything, even in legacyNamespace mode. This does that. It's a little hacky/dense, but the alternative is a lot of changes in many places, which will be a bigger diff and harder to be certain the impact is limited.

This is specifically useful for hooking up statsd to services like Hosted Graphite, but it should be more generally useful too.

I believe it also fixes a problem with the naming of the "global" prefix, where it's not actually "global". The naming implies it prefixes everything, but it only works in the new namespace mode.

Users using legacyNamespace with no globalPrefix won't be affected. Users not using legacyNamespace won't be affected. Users who are using legacyNamespace and who have a globalPrefix currently configured, but ignored, will be affected. This is likely to be a very small set of users who have tested not using the legacy namespace, but gone back to using it and not cleaned up their config. A message in the release notes should be sufficient to warn these users.

@derpston
Copy link
Author

Looks like this caused a test to fail, I didn't catch that. I'll investigate and update this later today.

@mrtazz
Copy link
Member

mrtazz commented Apr 14, 2014

I think this change makes sense in general, however I'd much rather have a less hacky version where we correctly set the prefix when building up the strings and not run a string replace afterwards.

@derpston
Copy link
Author

I'd prefer that too, but I think it might involve a refactor of the messy string building code. This seemed like the fastest way to make some progress, given the amount of time the clean solution will take.

Are there any plans to refactor this string building code to allow for this sort of change?

Alternatively, are there any plans to deprecate/remove the legacy namespace?

Wondering if perhaps the legacy namespace should be handled by a completely distinct backend plugin, and eliminate all those awkward string building conditionals.

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

2 participants