Add bootstrap check for disabling agent when required#2951
Merged
eyalkoren merged 21 commits intoelastic:mainfrom Jan 26, 2023
Merged
Add bootstrap check for disabling agent when required#2951eyalkoren merged 21 commits intoelastic:mainfrom
eyalkoren merged 21 commits intoelastic:mainfrom
Conversation
SylvainJuge
approved these changes
Jan 5, 2023
elastic-apm-agent/src/main/java/co/elastic/apm/agent/premain/ExcludeJvmBootstrapCheck.java
Outdated
Show resolved
Hide resolved
elastic-apm-agent/src/test/java/co/elastic/apm/agent/premain/ExcludeJvmBootstrapCheckTest.java
Outdated
Show resolved
Hide resolved
|
/test |
SylvainJuge
reviewed
Jan 25, 2023
Comment on lines
103
to
106
| 1. Allow JVM attachment only on Tomcat and a proprietary Java app: + | ||
| `-Delastic.apm.bootstrap_allowlist=\*org.apache.catalina.startup.Bootstrap*,my.cool.app.*` | ||
| 2. Disable when some custom System properties are set: + | ||
| `-Delastic.apm.bootstrap_exclude_list=custom.property.1,custom.property.2` |
Member
There was a problem hiding this comment.
[question] Does the patterns are matched against the whole JVM command line or only the main class and the system properties ?
Contributor
Author
There was a problem hiding this comment.
There is an explanation above for the allow list and in the table.
Is it not clear from those what is used in each?
As for the allowlist - it is only the main class or jar and JVM parameters, basically the contents of the sun.java.command system property. I will add this info. Let me know if anything else is required
Contributor
Author
|
@SylvainJuge I removed the default exclude list, as it doesn't seem required at this point. |
SylvainJuge
approved these changes
Jan 25, 2023
elastic-apm-agent/src/test/java/co/elastic/apm/agent/premain/ExcludeJvmBootstrapCheckTest.java
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
ELASTIC_APM_DISABLE_BOOTSTRAP_CHECKSenvironment variable, this is currently only possible with-Delastic.apm.disable_bootstrap_checksJVM argument (using JVM system properties), hence allowing to disable bootstrap checks when JVM arguments modification is not possible.Checklist