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

Make getScrapeConfigHash method exported instead of private #2435

Closed
rashmichandrashekar opened this issue Dec 13, 2023 · 3 comments
Closed

Comments

@rashmichandrashekar
Copy link
Contributor

Component(s)

target allocator

Describe the issue you're reporting

Change the visibility of getScrapeConfigHash method in target allocator's target package so that it can be reused in prometheus receiver in the open telemetry collector.
This can use used to fix the issue where regex changes in scrape config for metric relabelling doesn't get picked up when using target allocator.

@swiatekm
Copy link
Contributor

Do we need these methods to be identical? Exporting the method and depending on the target allocator package in Prometheus receiver is a lot of additional coupling, and I'd rather not do it if it's not absolutely necessary. Can't the receiver just implement the hashing its own way?

@jaronoff97
Copy link
Contributor

I agree with @swiatekm-sumo, I don't think we should expose this publicly as it will create a cyclic dependency between ourselves and the collector which we should avoid.

@rashmichandrashekar
Copy link
Contributor Author

@swiatekm-sumo - I was thinking having them identical gives us the benefit of keeping the behavior consistent between the 2 target allocator components. But, if we want to avoid the additional coupling I could just add the same method there too.

@jaronoff97 - Sounds good. Yes, the cyclic dependency will be a concern. Looks like the cons outweigh the pro here. I can just add the same method in the receiver too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants