[k159] Remove Prometheus dependency for push pkg #9956
Merged
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.
Backport 15af77b from #9937
What this PR does / why we need it:
In #9694, we modified the
push
pkg to import Prometheus as a dependency to use thelabels.Labels
type for the entries' non-indexed labels.Having Prometheus as a dependency is problematic since any project importing the
push
pkg will need to import Prometheus as a result. In fact, this is one of the reasons why thepush
pkg was extracted from Loki in the first place (#8259).This PR removes the dependency of Prometheus from the
push
pkg by copying some bits of the implementation for Prometheus'labels.Labels
. We copy:Notes for reviewers:
push
pkg now depends ongolang.org/x/exp
. I think it should be fine for projects importing thepush
pkg to also depend ongolang.org/x/exp
, right?