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

config: document options #363

Merged
merged 2 commits into from
Feb 22, 2022
Merged

config: document options #363

merged 2 commits into from
Feb 22, 2022

Conversation

roobre
Copy link
Contributor

@roobre roobre commented Feb 16, 2022

No description provided.

@roobre roobre requested a review from a team February 16, 2022 17:06
Comment on lines 142 to 158
// Autodiscover contains one or more criteria for discovering control plane endpoints. The first criteria that
// matches an endpoint will be attempted.
// If an endpoint matching the criteria is discovered but connection fails, the integration will skip to the next
// endpoint.
// The list of discovered endpoints is exhausted, either because of failure or because it is empty, the integration
// will understand there is no control plane component discoverable _at the current point in time_, and will keep
// probing for endpoints periodically.
Autodiscover []AutodiscoverControlPlane `mapstructure:"autodiscover"`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gsanchezgavier Can you take a look at this statements and ensure they are correct? I wrote this from the top of my head and I do remember that we changed the approach a couple times here.

Copy link
Contributor

@gsanchezgavier gsanchezgavier Feb 17, 2022

Choose a reason for hiding this comment

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

this is correct but i would clarify the difference between the Pod discovery and the endpoint probing. I made a suggestion below , feel free to take something or modify it

The component will iterate over the Autodiscover entries looking for the first Pod that matches the criteria (selector, namespace and matchNode). Then it probes the listed endpoints for that Autodiscover until the first one successfully responding.
If no Pod is discovered or non of the listed endpoints probes succeeds the integration understand there is no control plane component discoverable at the current point in time, and will keep probing.

Copy link
Contributor Author

@roobre roobre Feb 17, 2022

Choose a reason for hiding this comment

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

I'm still missing some bits, I think. Let me write a series of use cases here and we can check if they are correct:

Scenario Result
The first autodiscovery entry does not find a matching pod The integration will try the next autodiscovery entry
None of the autodiscovery entries find a matching pod The integration will keep probing for pods in case they appear later
All the endpoints configured for the first autodiscovery entry, which did find a pod, fail ??
The first endpoint configured for a pod that has been found fails The next endpoint is probed

Copy link
Contributor

@gsanchezgavier gsanchezgavier Feb 17, 2022

Choose a reason for hiding this comment

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

Copy link
Contributor

@gsanchezgavier gsanchezgavier Feb 17, 2022

Choose a reason for hiding this comment

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

so my explanation was wrong I will edit that comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gsanchezgavier So what would be the behavior for the third scenario in the table?

Copy link
Contributor

Choose a reason for hiding this comment

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

in that case it will not fail but it will not try with the rest of autodiscovery entries.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a bit weird, we might want to revisit that. I'll document it for now until we change it.

Copy link
Contributor

Choose a reason for hiding this comment

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

sure we can review it, not sure if there is a case where multiple entires could match in a cluster

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the comment accordingly, please LMK your thoughts @gsanchezgavier :)

@roobre roobre added the ci/skip-e2e E2E tests will be skipped for this PR label Feb 16, 2022
@paologallinaharbur
Copy link
Member

👏 👏 👏 I'll check it out tomorrow! But it looks awesome!

Copy link
Member

@paologallinaharbur paologallinaharbur left a comment

Choose a reason for hiding this comment

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

Thanks for taking are of this, apart from what guillermo is pointing out everything else looked good

internal/config/config.go Outdated Show resolved Hide resolved
internal/config/config.go Outdated Show resolved Hide resolved
roobre and others added 2 commits February 22, 2022 10:47
Co-authored-by: Guillermo Sanchez Gavier <gsanchez@newrelic.com>
@roobre roobre merged commit d84cea9 into main Feb 22, 2022
@roobre roobre deleted the config-docs branch February 22, 2022 12:52
roobre added a commit that referenced this pull request Feb 22, 2022
Co-authored-by: Guillermo Sanchez Gavier <gsanchez@newrelic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/skip-e2e E2E tests will be skipped for this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants