We would like to have different dynatrace configurations for UAT and Prod.
Currently when configuring the plugin, the only way is to add a file called dynatrace.config.js to the resources however when pushed into UAT and eventually Production, the same config is used across environments.
Is there a way to specify the config file per environment?
Hi Tye,
Find the attached OML file for ready reference.
PS: I missed out adding the folder name in the ConfigURL variable. So use the following expression
GetOwnerURLPath() + "Dynatrace/" + GetServerName.Name + ".config.js"
Hi @Tye Peck,
Were you able to use the OML sample I provided?
I wanted to suggest some more changes but let me know if the first one played well or not?
You can mark as solution if it already resolved your query.
Thanks
Ravi
Hi @Ravi Punjwani
Unfortunately we had attempted the dynamic configuration and when generating a native build we noticed the build kept failing due to the expectation of a file called dyantrace.config.js.
We have this configuration file but rename it according to the environments and dynamically load it as you suggested above i.e. dyantrace.dev.config.js, dyantrace.test.config.js etc however it seems the actual underlying plugin expects it to be called "dyantrace.config.js"
This is supported by investigating the dynatrace cordova package https://www.npmjs.com/package/@dynatrace/cordova-plugin
There does seem to be a way to specify a different dynatrace.config.js path (here) however as we don't have access to the underlying build system to pass any arguments, this does not seem possible.
Keen on hearing your thoughts on this, we are happy to use the one app for dev/test/prod however we will need a way of at least filtering out any telemetry from dev/test to not skew any reports.
As a quick and dirty way, so we don't need to make changes to the original plugin source, we did the following: