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

add_cloud_metadata asynchronous initialization #8845

Merged
merged 3 commits into from
Nov 10, 2018

Conversation

adriansr
Copy link
Contributor

Now that the add_cloud_metadata is enabled by default in all beats, we are losing 3 precious seconds every time a Beat is started outside a supported cloud environment.

This patch makes the cloud detection an asynchronous task so the Beat can start and only block if initialization is not completed at the time of the first enrichment.

Running in debug mode bypasses this parallelism as the processor needs to be initialized when its String() method is called.

Now that the add_cloud_metadata is enabled by default in all beats, we
are losing 3 precious seconds every time a Beat is started outside a
supported cloud environment.

This patch makes the cloud detection an asynchronous task so the Beat
can start and only block if initialisation is not completed at the time
of the first enrichment.

Running in debug mode bypasses this parallelism as the processor needs
to be initialised when its String() method is called.
@adriansr adriansr added enhancement discuss Issue needs further discussion. review labels Oct 31, 2018
Copy link
Member

@andrewkroh andrewkroh left a comment

Choose a reason for hiding this comment

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

SGTM 😄 . Needs a changelog.

Do you have any idea of what causes the full 3 sec timeout to be reached? IIRC it would fail quickly in the normal case because each request would result in a fast "no route to host" when connecting the link-local metadata IP address. Or perhaps we added new providers that connect to different addresses.

@adriansr
Copy link
Contributor Author

In my case it sits waiting on an ARP response for 169.254.169.254, which is used by most cloud providers as metadata service. Maybe a misconfiguration on my network?

@andrewkroh
Copy link
Member

I'm not sure. But I see that the Tencent provider requires a DNS lookup so at any point it could be one of several causes so I think this is a great addition.

@ph
Copy link
Contributor

ph commented Nov 1, 2018 via email

@adriansr
Copy link
Contributor Author

adriansr commented Nov 5, 2018

jenkins, test this

@exekias
Copy link
Contributor

exekias commented Nov 5, 2018

Any plans to backport this? 🙏

@adriansr
Copy link
Contributor Author

adriansr commented Nov 9, 2018

@andrewkroh @exekias care to have a final look at my last update?

@adriansr adriansr merged commit 737a0b9 into elastic:master Nov 10, 2018
@exekias exekias added the needs_backport PR is waiting to be backported to other branches. label Nov 10, 2018
adriansr added a commit to adriansr/beats that referenced this pull request Feb 1, 2019
Now that the add_cloud_metadata is enabled by default in all beats, we
are losing 3 precious seconds every time a Beat is started outside a
supported cloud environment.

This patch makes the cloud detection an asynchronous task so the Beat
can start and only block if initialization is not completed at the time
of the first enrichment.

Running in debug mode bypasses this parallelism as the processor needs
to be initialized when its String() method is called.

(cherry picked from commit 737a0b9)
@adriansr adriansr added v6.7.0 and removed needs_backport PR is waiting to be backported to other branches. labels Feb 1, 2019
adriansr added a commit that referenced this pull request Feb 4, 2019
Now that the add_cloud_metadata is enabled by default in all beats, we
are losing 3 precious seconds every time a Beat is started outside a
supported cloud environment.

This patch makes the cloud detection an asynchronous task so the Beat
can start and only block if initialization is not completed at the time
of the first enrichment.

Running in debug mode bypasses this parallelism as the processor needs
to be initialized when its String() method is called.

(cherry picked from commit 737a0b9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss Issue needs further discussion. enhancement review v6.7.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants