opentelemetry-collector-contrib icon indicating copy to clipboard operation
opentelemetry-collector-contrib copied to clipboard

Fix for - syncTargetAllocator in prometheus metrics receiver doesnt detect regex changes in metrics relabel config

Open rashmichandrashekar opened this issue 1 year ago • 12 comments

Description: <Describe what has changed.> Fixing a bug - With the Targetallocator component in prometheus receiver, when prometheus scrape config is updated for metric relabel config with just regex change, the prometheus metrics receiver doesn't update the hash and hence doesn't pick up the metrics relabel config with the new regex. This is because the regex struct has unexported fields. This fix similar to the fix made in opentelemetry-operator fixes this issue by taking into account the unexported fields as well.

Link to tracking Issue: - #29313

Testing: Tested to make sure that just the regex changes in metric relabeling gets picked up with TargetAllocator enabled.

Reopening this PR since the old one(https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/30258) got closed due to inactivity.

rashmichandrashekar avatar Apr 02 '24 18:04 rashmichandrashekar

@Aneurysm9 @dashpole - Please take a look and let me know if you have any questions/concerns. Thanks!

rashmichandrashekar avatar Apr 02 '24 20:04 rashmichandrashekar

@Aneurysm9 @dashpole - Please take a look and let me know if you have any questions/concerns. Thanks!

@Aneurysm9 @dashpole - Gentle ping. Checking back. Pls take a look and let me know if you have any feedback. Thanks!

rashmichandrashekar avatar Apr 08 '24 17:04 rashmichandrashekar

@Aneurysm9 @dashpole - Please take a look and let me know if you have any questions/concerns. Thanks!

@Aneurysm9 @dashpole - Gentle ping. Checking back. Pls take a look and let me know if you have any feedback. Thanks!

@Aneurysm9 - I have addressed the feedback from the sig meeting. Please take a look. Thanks!

rashmichandrashekar avatar Apr 20 '24 01:04 rashmichandrashekar

@Aneurysm9 @dashpole - Please take a look and let me know if you have any questions/concerns. Thanks!

@Aneurysm9 @dashpole - Gentle ping. Checking back. Pls take a look and let me know if you have any feedback. Thanks!

@Aneurysm9 - I have addressed the feedback from the sig meeting. Please take a look. Thanks!

@Aneurysm9 - Gentle ping, pls take a look and let me know if you have any feedback. Thanks!

rashmichandrashekar avatar Apr 23 '24 17:04 rashmichandrashekar

@Aneurysm9 @dashpole - Please take a look and let me know if you have any questions/concerns. Thanks!

@Aneurysm9 @dashpole - Gentle ping. Checking back. Pls take a look and let me know if you have any feedback. Thanks!

@Aneurysm9 - I have addressed the feedback from the sig meeting. Please take a look. Thanks!

@Aneurysm9 - Gentle ping, pls take a look and let me know if you have any feedback. Thanks!

@dashpole / @Aneurysm9 - Could you please take a look at the PR when you get a chance? Thanks!

rashmichandrashekar avatar Apr 25 '24 17:04 rashmichandrashekar

@Aneurysm9 @dashpole - Please take a look and let me know if you have any questions/concerns. Thanks!

@Aneurysm9 @dashpole - Gentle ping. Checking back. Pls take a look and let me know if you have any feedback. Thanks!

@Aneurysm9 - I have addressed the feedback from the sig meeting. Please take a look. Thanks!

@Aneurysm9 - Gentle ping, pls take a look and let me know if you have any feedback. Thanks!

@dashpole / @Aneurysm9 - Could you please take a look at the PR when you get a chance since its been pending for quite sometime? Thanks!

rashmichandrashekar avatar Apr 25 '24 17:04 rashmichandrashekar

@rashmichandrashekar could you please rebase your branch, so your PR only has changes to the prometheus receiver? Right now, it has a bunch of other random changes.

swiatekm avatar May 02 '24 10:05 swiatekm

@rashmichandrashekar could you please rebase your branch, so your PR only has changes to the prometheus receiver? Right now, it has a bunch of other random changes.

Thanks @swiatekm-sumo. It is done. The changes now are all relevant to the go mod and go sum for the hashstructure module removal.

rashmichandrashekar avatar May 02 '24 19:05 rashmichandrashekar

@djaglowski - Following up. Could you please take a look at this PR? I see that you are assigned to this. Thanks!

rashmichandrashekar avatar May 02 '24 19:05 rashmichandrashekar

@dashpole - Gentle ping. Could you please review when you get a chance? Thanks!

rashmichandrashekar avatar May 08 '24 15:05 rashmichandrashekar

@dashpole - Gentle ping. Could you please review when you get a chance? Thanks!

@dashpole / @Aneurysm9 - Ping. Please let me know if there's any other feedback. We have been waiting on this to be fixed to take the new collector release. Could you also please provide an ETA if possible as to when this might be looked into?

rashmichandrashekar avatar May 20 '24 22:05 rashmichandrashekar

@dashpole - Gentle ping. Could you please review when you get a chance? Thanks!

@dashpole / @Aneurysm9 - Ping. Please let me know if there's any other feedback. We have been waiting on this to be fixed to take the new collector release. Could you also please provide an ETA if possible as to when this might be looked into?

@djaglowski - I see you assigned to this PR. Could you pls take a look and let me know your feedback. Thanks!

rashmichandrashekar avatar May 21 '24 17:05 rashmichandrashekar

I'm not sure I'm willing to accept this. I don't want to own a hashing library. We are working on splitting out the target allocator into its own module in https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/33146 so it can have separate owners. If the future owners of the module want to own a hashing library, thats up to them.

dashpole avatar May 22 '24 17:05 dashpole

@rashmichandrashekar it looks like we might be moving the target allocator related code to its own package, as per #33146. For that reason, your PR might need to wait until that's decided. Apologies for the wait, and thank you for your patience.

swiatekm avatar May 22 '24 17:05 swiatekm

@rashmichandrashekar it looks like we might be moving the target allocator related code to its own package, as per #33146. For that reason, your PR might need to wait until that's decided. Apologies for the wait, and thank you for your patience.

Thanks @swiatekm-sumo for letting me know. Please let me know when the move is done and owners are decided and I can update the PR with any feedback from the owners of the code.

rashmichandrashekar avatar May 22 '24 17:05 rashmichandrashekar

I'm not sure I'm willing to accept this. I don't want to own a hashing library. We are working on splitting out the target allocator into its own module in #33146 so it can have separate owners. If the future owners of the module want to own a hashing library, thats up to them.

Thanks @dashpole. I will follow up with @swiatekm-sumo / future owners to get feedback and update the PR.

rashmichandrashekar avatar May 22 '24 17:05 rashmichandrashekar

@rashmichandrashekar it looks like we might be moving the target allocator related code to its own package, as per #33146. For that reason, your PR might need to wait until that's decided. Apologies for the wait, and thank you for your patience.

Thanks @swiatekm-sumo for letting me know. Please let me know when the move is done and owners are decided and I can update the PR with any feedback from the owners of the code.

@swiatekm-sumo / @dashpole - Are the new owners for the targetallocator component figured out? I can follow up with the right owners while the code is being split to address any comments.

rashmichandrashekar avatar Jun 04 '24 17:06 rashmichandrashekar

@rashmichandrashekar it looks like we might be moving the target allocator related code to its own package, as per #33146. For that reason, your PR might need to wait until that's decided. Apologies for the wait, and thank you for your patience.

Thanks @swiatekm-sumo for letting me know. Please let me know when the move is done and owners are decided and I can update the PR with any feedback from the owners of the code.

@swiatekm-sumo / @dashpole - Are the new owners for the targetallocator component figured out? I can follow up with the right owners while the code is being split to address any comments.

@swiatekm-sumo - As the new potential code owner, would you like me to update these changes to get rid of the library and have the same changes as the operator repo and address the comment for sorting the keys? Please lmk as this PR has been waiting for a while.

rashmichandrashekar avatar Jun 11 '24 00:06 rashmichandrashekar

@rashmichandrashekar yeah, in my opinion we should do something very similar to what the target allocator does and just serialize the configs to yaml, and hash the output. They should be sorted, to avoid map ordering inconsistencies.

swiatekm avatar Jun 11 '24 10:06 swiatekm

LGTM

Thanks @swiatekm for the quick review and approval. @dashpole - Could you pls help get this merged?

rashmichandrashekar avatar Jul 09 '24 16:07 rashmichandrashekar

LGTM

Thanks @swiatekm for the quick review and approval. @dashpole - Could you pls help get this merged?

@dashpole - Following up, could you pls help get this merged as this has been waiting for several months?

rashmichandrashekar avatar Jul 10 '24 19:07 rashmichandrashekar

Ack. I'm OK with the general approach now. I'll try to review soon

dashpole avatar Jul 10 '24 19:07 dashpole