Allow the metric family injection hook to merge with existing metric fam... #97
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
...ilies.
If a metric family returned by the injection hook already exists (with
the same name), then its metrics are simply merged into that metric
family. With enabled collect-time checks, even uniqueness is checked,
but in general, things stay the same that the caller is responsible to
ensure metric consistency.
This fixes prometheus/pushgateway#27 .
@juliusv @brian-brazil
Note that we still want a way to switch off the automatic process metrics (which is being worked on, it just takes some time to do it right).
With this PR, at least everything works, but it will create inconsistent metrics (pushed process metrics end up with an additional "exporter_job" label, for example). But that problem is a bigger one, too. (I believe we discussed the problem with adding the exporter labels elsewhere...)