I'm trying to use Azure Application Insight in Cuba Platform: https://learn.microsoft.com/en-us/azure/application-insights/app-insights-java-get-started
I managed to add the library to Cuba Platform, in particular to the Web module, but I couldn't set the "Instrumentation key" in any way.
There are three ways to do so:
1- Putting ApplicationInsights.xml in the "resource" folder
I couldn't find a place to put the file to be read by TelemetryConfigurationFactory class. Internally, I see it's using getResource() to scan in various "sensible" places. I tried WEB-INF, META-INF, conf directory in Tomcat, conf/app, root of java package, work/app in Tomcat and probably something more with no results.
2- System property: -DAPPLICATION_INSIGHTS_IKEY=your_ikey
3- Environment variable: APPLICATION_INSIGHTS_IKEY
Tried both in a docker container, tried the last one locally: no results. In particular, System.getEnv is returning null even after exporting manually the variable locally, so this could be some error on my side
Any insight :D is welcome