-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Allow file-based configuration for Dynatrace v2 exporter #2916
Allow file-based configuration for Dynatrace v2 exporter #2916
Conversation
Hey @jonatan-ivanov and @shakuzen, it would be great if someone could take a look at this PR please, it has been sitting for a while now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's merge this and I'm going to add a polish commit.
Thanks @pirgeo! |
public class FileBasedConfigurationTestHelper { | ||
// This allows overwriting the file location of the file-based configuration for testing. | ||
public static void forceOverwriteConfig(String filename) { | ||
DynatraceFileBasedConfigurationProvider.getInstance().forceOverwriteConfig(filename); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just realized why is this needed.
Is it possible to make it public or release a test dependency where this is available?
@pirgeo I think there are some issues with the Dynatrace file poller, it seems it takes a lot of time on macOS for the file poller to detect the changes. The tests in this PR were failing for me on my mac (OS X 12.1, x86_64): see this report. My changes: jonatan-ivanov@f4c1c42 (they are unrelated since the build was failing for me at the first place). |
This PR introduces support for file-based configuration using the
DynatraceFileBasedConfigurationProvider
. It also makes sure changes in the file-based configuration are picked up, without having to restart the app to change configuration.This change adds another layer to the auto-configuration that is already available: Instead of falling back to the local OneAgent directly, the the file at
/var/lib/dynatrace/enrichment/endpoint/endpoint.properties
will be checked for configuration. The file will typically be provided by the Dynatrace Operator but can also just be added manually if you'd like to test it locally. I will follow up with a PR updating the documentation inmicrometer-docs
to describe the changes.