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

Jobs/insrtances documentation disambiguity #957

Closed
msiebuhr opened this Issue Aug 3, 2015 · 15 comments

Comments

Projects
None yet
4 participants
@msiebuhr
Copy link
Contributor

msiebuhr commented Aug 3, 2015

When submitting data with job and/or instance-tags set, say foo{job="a.herokuapp.com",instance="b"}, the docs say it will add new keys with exports_-prefix.

But instead it renames the existing keys to something exports_job and exports_instance, which isn't really useful, as grouping metrics from different upstreams by these keys would group a lot of data by the aggregator's name instead of the original job/instance names.

@msiebuhr

This comment has been minimized.

Copy link
Contributor Author

msiebuhr commented Aug 3, 2015

@juliusv

This comment has been minimized.

Copy link
Member

juliusv commented Aug 3, 2015

Thank you! This indeed changed in 0.15.0 and it wasn't updated in the docs yet. Here's the PR to fix it: prometheus/docs#148

@msiebuhr

This comment has been minimized.

Copy link
Contributor Author

msiebuhr commented Aug 3, 2015

After thinking it over, I think I'd prefer it be the other way around (i.e. that Prometheus doesn't mess with the existing keys); I have a proxy that ingests the runtime data for a bunch of heroku-machines (see https://github.com/msiebuhr/lumbermill/tree/prometheus). So I have a whole lot of infrastructure that is exposed through a proxy, which means it will (currently) end up like this in prometheus:

some_metric{job="lumbermill",instance="https://...",exported_job="real-server-instance",exported_instance="web.1"}
some_metric{job="lumbermill",instance="https://...",exported_job="real-server-instance",exported_instance="web.2"}
...
# And then some regular job/instance stuff
some_metric{job="system-name",instance="hostname"}

Grouping by job or instance, is in this case meaningless, as most of the metrics will be attributed to the proxy server that is needed to even get the logs to prometheus. Grouping/aggregating by exported_ means that all the "normally" fetched data will show up under one big empty key.

@msiebuhr

This comment has been minimized.

Copy link
Contributor Author

msiebuhr commented Aug 3, 2015

I'm quite curious as to why Prometheus ended up with this behaviour. Any pointers?

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Aug 3, 2015

Basically if one rogue job starts exporting metrics with labels owned by something else, this keeps it from being a problem.

@msiebuhr

This comment has been minimized.

Copy link
Contributor Author

msiebuhr commented Aug 3, 2015

But you could catch that just as well with just adding tags under exports_, proxy_ or whatever prefix.

For now, I've "fixed" it by adding dyno and app-tags (also maps better to how Heroku names things).

(I have a nagging feeling I'm missing some corner-case that disproves my idea...)

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Aug 3, 2015

But you could catch that just as well with just adding tags under exports_, proxy_ or whatever prefix.

Unless that's what the rogue job is exporting. We have to design things with all possible reasonable use-cases in mind, and that includes where the person running the Prometheus doesn't trust those writing the monitored jobs not to mess up the labels.

@beorn7

This comment has been minimized.

Copy link
Member

beorn7 commented Aug 3, 2015

@msiebuhr There is also the new honor_labels setting in the scrape config (which will be documented soon, prometheus/docs#137 ). That allows you to explicitly whitelist a scrape config to trust the labels.

@msiebuhr

This comment has been minimized.

Copy link
Contributor Author

msiebuhr commented Aug 3, 2015

So (haven't looked at the code) the current behaviour if foo{job="a",exports_job="b"} is to change it to foo{job="proxy_job_name","exports_job="a"}, and entirely discarding the existing exports_job? At least I find that a bit contrived, considering it makes using the two "core" tags useless if the data comes through proxies..

I believe you'd get the same security by plainly setting exports_job on the server, if job is set (overwriting any existing tag). And the jobs-tag would actually be useful.

@msiebuhr

This comment has been minimized.

Copy link
Contributor Author

msiebuhr commented Aug 3, 2015

@beorn7 Great! honor_labels it is.

@beorn7

This comment has been minimized.

Copy link
Member

beorn7 commented Aug 3, 2015

@msiebuhr The prefix is exported, and foo{job="a",exported_job="b"} would result in foo{job="proxy_job_name",exported_job="a",exported_exported_job="b"}.

@juliusv

This comment has been minimized.

Copy link
Member

juliusv commented Aug 5, 2015

@juliusv

This comment has been minimized.

Copy link
Member

juliusv commented Aug 5, 2015

Anything missing here still or can this be closed?

@msiebuhr

This comment has been minimized.

Copy link
Contributor Author

msiebuhr commented Aug 5, 2015

Looking under federation for how to piece together my Heroku-proxy thingie (indeed, I only looked at the page, now you linked to it).

Besides that nitpick, 👍

@msiebuhr msiebuhr closed this Aug 5, 2015

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 24, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 24, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.