-
Notifications
You must be signed in to change notification settings - Fork 211
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
Document a new "join" block in discovery.relabel #1541
Conversation
Since our current approach seems to have standard library functions to manipulate arrays and maps which we use for prometheus targets (such as array.concat), I was wondering if we should instead make this a stdlib concept? For example an Or any other option similar form in stdlib. It would make it work with potential other telemetry ecosystems. |
@thampiotr The reason I didn't opt for a stdlib function is that the ergonomics might not be as good. This is because not all labels from the SD should be taken into account. Suppose you have these labels from k8s SD:
Let's say you want to join on the "pod_ip" label. How would you join the "container" labels? The solution I decided to go with is to remove labels which are not in |
In this case I would expect to have a stdlib function that would allow me to get the necessary You can also have a different merge strategy for the |
This PR has not had any activity in the past 30 days, so the |
@thampiotr I think you're right - probably an inner join is a better way to go. I opened #1826 for it, and I'm going to close this PR because it's unlikely to be the solution we go with. Thank you for the feedback! |
PR Description
The main use case driving this is adding labels from
discovery.kubernetes
to targets coming fromprometheus.exporter
components. If you can also think of other use cases, please drop a comment in the PR.Instead of writing a proposal for the
join
block, I decided to just write the documentation for it. If you agree that the proposed functionality is reasonable, I will update this PR with the code implementation of the new block. I could then take the PR out of the draft stage.Which issue(s) this PR fixes
Fixes ##1443
Notes to the Reviewer
Initially I meant to solve this problem using dynamic pipelines. Unfortunately, that proved to be very difficult. The approach in this PR would be easier to implement.
PR Checklist