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

k8sobserver: only record pod endpoints for running pods #5878

Merged

Conversation

jfmyers9
Copy link
Contributor

Description:

This change updates the k8sobserver to only add a pod level endpoint if the Pod is currently running.

This prevents a situation in which receivers consuming from the k8sobserver would continue to interact with a Pod endpoint after the Pod had completed. In the worst case this would result in misleading results as other running pods could re-use the Pod's IP address and telemetry data would be misattributed.

Specifically, we observed this issue when using the receivercreator to scrape prometheus endpoints from pods associated with long running jobs.

Note: Should this be a configuration option? Are there ever situation in which a resource would like to track endpoints for non running pods?

Link to tracking Issue:

Testing:

Unit tests.

Documentation:

Unclear if this is necessary. But will add if needed.

This change updates the k8sobserver to only add a pod level endpoint if
the Pod is currently running.

This prevents a situation in which receivers consuming from the
k8sobserver would continue to interact with a Pod endpoint after the Pod
had completed. In the worst case this would result in misleading results
as other running pods could re-use the Pod's IP address and telemetry
data would be misattributed.
@jfmyers9 jfmyers9 requested review from a team and bogdandrutu October 23, 2021 18:17
Copy link
Contributor

@anuraaga anuraaga left a comment

Choose a reason for hiding this comment

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

Agree that there seem to only be bad things that can happen with these endpoints, for example when then used by the prometheus receiver, no good ones.

@jfmyers9
Copy link
Contributor Author

@anuraaga Seems to have failed on a load test, but its not clear to me how this change would impact that. Any ideas?

@bogdandrutu
Copy link
Member

/cc @owais @dmitryax

@jfmyers9
Copy link
Contributor Author

jfmyers9 commented Nov 1, 2021

Hey folks, any thoughts on this one? Would love to be able to rely on the k8sobserver for this use case.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 9, 2021

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label Nov 9, 2021
@jfmyers9
Copy link
Contributor Author

jfmyers9 commented Nov 9, 2021

Commenting to prevent this issue from being closed.

@github-actions github-actions bot removed the Stale label Nov 10, 2021
@github-actions
Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label Nov 17, 2021
@jfmyers9
Copy link
Contributor Author

This is still an issue. Would love to reach a resolution here so we can leverage the K8s Observer for metrics.

@github-actions github-actions bot removed the Stale label Nov 18, 2021
@jfmyers9
Copy link
Contributor Author

@bogdandrutu @anuraaga Just a friendly ping. Are there any outstanding questions here? Is there anything I can do on my end to push this forward?

@anuraaga
Copy link
Contributor

@jpkrohling Would you be able to merge this one?

Copy link
Member

@jpkrohling jpkrohling left a comment

Choose a reason for hiding this comment

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

LGTM

@jpkrohling jpkrohling merged commit c3f0a18 into open-telemetry:main Nov 25, 2021
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.

4 participants