8000 Allow GraphiteBridge to set a prefix · Issue #49 · prometheus/client_python · GitHub
[go: up one dir, main page]

Skip to content

Allow GraphiteBridge to set a prefix #49

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

Closed
hynek opened this issue Oct 2, 2015 · 5 comments
Closed

Allow GraphiteBridge to set a prefix #49

hynek opened this issue Oct 2, 2015 · 5 comments

Comments

@hynek
Copy link
Contributor
hynek commented Oct 2, 2015

Hi,

while testing and maybe transitioning, I’m very grateful for the GraphiteBridge.

However as far as I can tell, there’s no way to namespace (with a dot) my metrics and they just land in the main “directory”.

Could you please add a way to set a prefix that is prepended to all metrics?

@brian-brazil
Copy link
Contributor

That sounds like a reasonable and simple request, I'll add it to the Hacktoberfest list.

@kvikas
Copy link
kvikas commented Oct 3, 2015

Hi Brian,

I was looking into this. Does this mean bridge.graphite.GraphiteBridge.push() needs an optional namespace parameter? And it gets _sanitize()ed with . preserved and prepended to name.

@brian-brazil
Copy link
Contributor

I'd add an optional prefix parameter so as not to confuse it with the namespace parameter that Prometheus client libraries have. I'm not sure there's any need to sanitize it, as it's provided by a user that knows that it's going to graphite and what storage backend they have - unlike normal label values which can be arbitrary Unicode.

kvikas pushed a commit to kvikas/client_python that referenced this issue Oct 3, 2015
1. An optional `prefix` parameter in `bridge.graphite.GraphiteBridge.push()`.
2. `prefix` is prepended to metrics name before sending to graphite server.
3. Unit test.
kvikas pushed a commit to kvikas/client_python that referenced this issue Oct 3, 2015
1. Added an optional parameter `prefix` to `bridge.graphite.GraphiteBridge.push()`.
2. Initialize _RegularPush with `prefix`.
@brian-brazil
Copy link
Contributor

Fixed by #56

@hynek
Copy link
Contributor Author
hynek commented Oct 4, 2015

Sweet, thanks!

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

No branches or pull requests

3 participants
0