question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dynamic configuration with property files

See original GitHub issue

Hi all, Currently I use elasticapm.properties (put in the same directory as the agent file) to configure the agent. Screen Shot 2020-04-07 at 21 45 14 In this file, I’ve following configuration for trace methods:

trace_methods=abc.xyz
trace_methods_duration_threshold=10ms

The configuration works fine until I want to modify trace_methods. From the documentation, it say that trace_methods supports dynamic configuration but when I remove or add new methods, it does not reload automatically. I have to restart the application manually to get the config applied. Can you guys help me to troubleshoot this problem and get dynamic configuration working? Thanks in advance.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
felixbarnycommented, Apr 8, 2020

I’ve found the issue, it’s a bug 🤦‍♂

https://github.com/elastic/apm-agent-java/blob/97a3d763a9468fcbb2e9c8a0241a5afecb5186fe/apm-agent-core/src/main/java/co/elastic/apm/agent/bci/ElasticApmAgent.java#L196

it should be

        resettableClassFileTransformer = agentBuilder.patchOn(instrumentation, resettableClassFileTransformer);
0reactions
duclm2609commented, Apr 7, 2020

I also think that there is a delay before the configuration getting applied, so I’ve waited for 5 minutes. But nothing changes. It only applies when I restart the service.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to configure application dynamically via property files
In some use cases, an application needs to define elements through a properties file and to be able to modify these elements dynamically...
Read more >
Specifying an Application Configuration Property Dynamically
To specify application configuration properties, you can use the static approach or the dynamic approach. Using the static approach, you specify a property...
Read more >
A Simple Implementation of Dynamic Configuration - Medium
With Apache Zookeeper, dynamic configuration properties can be organized in a directory structure such as “/namespace/profile/name”, where each ...
Read more >
Dynamically set all properties files at runtime: - Stack Overflow
The only way to dynamically update properties of an app would be to use something like a configuration server. Read about it here....
Read more >
How to create and store property file dynamically in Java?
It is represented by the Properties class in Java, you can store a properties file and read from it using the methods of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found