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

[FIX]: adds case to handle kubeletstats reciever to ignore endpoint #558

Conversation

mritunjaysharma394
Copy link
Contributor

This PR is an attempt to fix #527 to ignore certain kubeletstats receivers when deriving service from config
Signed-off-by: Mritunjay Sharma [email protected]

@mritunjaysharma394 mritunjaysharma394 requested review from a team and bogdandrutu November 17, 2021 20:14
@jpkrohling
Copy link
Member

@VineethReddy02, could you please review this one as you are familiar with this code?

@@ -100,6 +100,11 @@ func singlePortFromConfigEndpoint(logger logr.Logger, name string, config map[in
case name == "tcplog" || name == "udplog":
endpoint = getAddressFromConfig(logger, name, listenAddressKey, config)

// in case of kubeletstats reciever, the endpoint is ignored
case name == "kubeletstats":
endpoint = nil
Copy link
Contributor

@VineethReddy02 VineethReddy02 Nov 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All you have to do is return nil here. No use of nil assignment. Also, add unit tests for the same.

Add detailed comment for future reference on this special case:

   // ignore kubeletstats receiver as it holds the field key endpoint, and it
   // is a scraper, we only expose endpoint through k8s service objects for
   // receivers that aren't scrapers.
   case name == "kubeletstats":
	   return nil

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @VineethReddy02 and @jpkrohling for your review and suggestions, really learned so much through this process! Have added a commit with your suggestions, do let me know for any other changes, thanks a lot again for all the help 😄

@VineethReddy02
Copy link
Contributor

@mritunjaysharma394 can you re-iterate on the suggested changes?

@mritunjaysharma394
Copy link
Contributor Author

Hi @VineethReddy02 , thanks a lot for the review and suggestions, I will complete the suggested changes by tomorrow, sorry for the delay due to exams!

@VineethReddy02 VineethReddy02 force-pushed the kubeletstats-ignore-reciever branch 2 times, most recently from 541d587 to 8f61c06 Compare December 10, 2021 20:25
@VineethReddy02 VineethReddy02 force-pushed the kubeletstats-ignore-reciever branch from 8f61c06 to 8d47f26 Compare December 14, 2021 18:04
@VineethReddy02 VineethReddy02 merged commit 9e2c3c3 into open-telemetry:main Dec 14, 2021
ItielOlenick pushed a commit to ItielOlenick/opentelemetry-operator that referenced this pull request May 1, 2024
…pen-telemetry#558)

* adds case to handle kubeletstats receiver to ignore endpoint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a mechanism to ignore certain receivers when deriving service from config
3 participants