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

Document and re-order classpath configuration priority #959

Closed
SylvainJuge opened this issue Dec 5, 2019 · 3 comments · Fixed by #1087
Closed

Document and re-order classpath configuration priority #959

SylvainJuge opened this issue Dec 5, 2019 · 3 comments · Fixed by #1087
Assignees
Milestone

Comments

@SylvainJuge
Copy link
Member

SylvainJuge commented Dec 5, 2019

Issue description

Agent configuration can be provided through an elasticapm.properties file in the application classpath, which is required for applications that use Attach API.

There are a few issues:

Proposal

Document all the layers (including the implicit ones) of the configuration with their priority:

  1. Remote configuration
  2. elastic.apm.* JVM properties
  3. ELASTIC_APM_* environment variables
  4. external elasticapm.properties in filesystem (if any)
  5. elasticapm.properties file in application classpath
  6. Agent default configuration

Make agent configuration loading implement this ordering, which will be a breaking change for people who rely on current behavior where elasticapm.properties in classpath is always applied with highest priority which prevents overriding it remotely.

@felixbarny felixbarny added this to the 7.7 milestone Jan 27, 2020
@SylvainJuge SylvainJuge self-assigned this Mar 16, 2020
@SylvainJuge
Copy link
Member Author

Actually, after reading the code a bit, the ordering of

external elasticapm.properties in filesystem (if any)

is wrong, as the location to the file can be overridden through JVM properties and environment variables, which means that in practice due to this dependency, it's just below remote configuration in this list.

@eyalkoren
Copy link
Contributor

Actually, after reading the code a bit, the ordering

Moreover, it makes sense to promote the external elasticapm.properties file anyway, as it is also a way of making config options dynamic, which means its contents need to take precedence over non-dynamic ones.

@SylvainJuge
Copy link
Member Author

After checking with @felixbarny Tuesday, I mistakenly thought the order of non-remote options was in reverse. The external elasticapm.properties file is applied after java system properties and os environment variables.

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 a pull request may close this issue.

3 participants