microsoft / ApplicationInsights-Java

Application Insights for Java
http://aka.ms/application-insights
Other
296 stars 200 forks source link

Application Insights Appender missing ability to use connection string #2928

Closed Ricky-G closed 1 year ago

Ricky-G commented 1 year ago

Is your feature request related to a problem? Please describe. There are situations where we cant' use the App Insights agent, a prime example we encountered is with Mulesoft which runs as a SaaS/iPaaS offering and each layer instance of an API runs as an isolated Java application. We don’t have access to the JVM to attach the Application Insights Agent. See https://help.mulesoft.com/s/article/Unable-to-use-javaagent-on-Cloudhub

They do support Log4j2 Appenders. We use https://mvnrepository.com/artifact/com.microsoft.azure/applicationinsights-logging-log4j2. The last release for this is 2.6.4.

This currently only supports instrumentation key and no support for connection string. With the instrumentation key being deprecated in 2025 what are the options to keep using the appender?

Describe the solution you would like Ideally would like to see an update to the appender with the ability to use connection string, alternatively are there other options available here?

Additional context On March 31, 2025, support for instrumentation key ingestion will end. Instrumentation key ingestion will continue to work, but we'll no longer provide updates or support for the feature. Transition to connection strings to take advantage of new capabilities.

trask commented 1 year ago

hi @Ricky-G!

this should be possible using the standalone azure monitor opentelemetry exporter along with the opentelemetry log4j2 appender instrumentation

let us know if you have trouble with this, thx

Ricky-G commented 1 year ago

Hi @trask,

Thank you very much for getting back, using the standalone open telemetry exporter and then using the log4j2 appender to push to Azure Monitor.

This suggested approach will work for us for now, so please feel free to close this issue.