Add ability to specify directory that libasyncProfiler is exported to, to support /tmp partitions that have noexec set#1350
Merged
eyalkoren merged 6 commits intoelastic:masterfrom Aug 20, 2020
Conversation
…, to support /tmp partitions that have noexec set - Add elastic.apm.profiling_inferred_spans_lib_directory property that can be set to specify a directory which should be used to place the libasyncProfiler.so shared library, so that it can take a value such as /var/tmp when running in a server-hardened environment, without needing to change the `java.io.tmpdir` system property which would apply to the system being profiled as well. If not set, the `java.io.tmpdir` system property is used as before - When loading the library, catch any UnsatisfiedLinkError errors, which would usually indicate a /tmp partition that has noexec set, and and re-throw the exception with a message to suggest setting the property - Add unit tests which cover this configurable behaviour - Update changelog and configuration docs Fixes elastic#1226
|
💚 CLA has been signed |
d5a821d to
74f1c05
Compare
felixbarny
approved these changes
Aug 20, 2020
Member
felixbarny
left a comment
There was a problem hiding this comment.
It was really hard to find something to criticize 😄
Just some minor comments and suggestions
Great job and thanks for your contribution 👏
...ling-plugin/src/test/java/co/elastic/apm/agent/profiler/asyncprofiler/AsyncProfilerTest.java
Outdated
Show resolved
Hide resolved
...ling-plugin/src/test/java/co/elastic/apm/agent/profiler/asyncprofiler/AsyncProfilerTest.java
Outdated
Show resolved
Hide resolved
...rofiling-plugin/src/main/java/co/elastic/apm/agent/profiler/asyncprofiler/AsyncProfiler.java
Outdated
Show resolved
Hide resolved
...apm-profiling-plugin/src/main/java/co/elastic/apm/agent/profiler/ProfilingConfiguration.java
Outdated
Show resolved
Hide resolved
...apm-profiling-plugin/src/main/java/co/elastic/apm/agent/profiler/ProfilingConfiguration.java
Outdated
Show resolved
Hide resolved
...apm-profiling-plugin/src/main/java/co/elastic/apm/agent/profiler/ProfilingConfiguration.java
Outdated
Show resolved
Hide resolved
- Use backticks in documentation - Remvove ProfilingConfiguration dependency in AsyncProfiler getInstance() method - Add package-private reset method to reset AsyncProfiler singleton - Use JUnit @tempdir to simplify temp directory creation in unit test
Contributor
Author
Thanks for the speedy review and feedback! Plus the work that makes this an easy project to build/test/contribute to |
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.profiling_inferred_spans_lib_directoryproperty that can be set to specify a directory which should be used to place the libasyncProfiler.so shared library, so that it can take a value such as/var/tmpwhen running in a server-hardened environment, without needing to change thejava.io.tmpdirsystem property which would apply to the system being profiled as well. If not set, thejava.io.tmpdirsystem property is used as before.Fixes #1226
Checklist