0

My goal is to to enable application insights for our java 8 app services on Windows. I'd like to implement codeless application insights if possible, but I'm uncertain whether this is currently supported for Java app services.

When I visit any documentation page regarding code-based application insights for Java, I am recommended to use the new Java 3.0 agent for Application Insights, which supports codeless monitoring.

However, the table on this page indicates that this is not yet supported for Java app services. But further down the same page it says: "The portal integration for monitoring of Java applications on App Service on Windows is currently unavailable, however, you can add Application Insights Java 3.0 standalone agent to your application without any code changes before deploying the apps to App Service. Application Insights Java 3.0 agent is generally available."

It's not clear to me what is meant with "portal integration" here. I have tried to implement the 3.0 agent using this documentation, and so far it works from my local machine, but not (yet) when deployed to the app service. So my question is whether I'm doing something wrong or that it isn't supported currently.

Thanks

t.amsing
  • 169
  • 7
  • Can you share more details how do you deploy java ? I am using Spring boot and App Insights in kubernetes no problem at all – Vova Bilyachat Apr 08 '21 at 01:08

2 Answers2

3

Answer is posted here https://github.com/microsoft/ApplicationInsights-Java/issues/1615

All you need to do:

  1. Enable application insights for the app service and specify an app insights instance
  2. Add this application setting; XDT_MicrosoftApplicationInsights_Java -> 1
t.amsing
  • 169
  • 7
0

I think what mentioned in the doc about codeless application insights is like this:

enter image description here

After deploying my springboot app to azure web app (windows, java 8, standard S1), we can enable application insights by turn the button to 'enable' in the screenshot above. And even I didn't add app insights sdk in my code, I can still get trace and other information.

enter image description here

=============================UPDATE================================

I found after adding these three settings in the configuration, the application insights will also automatically collect traces from the program. Weird! enter image description here

Tiny Wang
  • 10,423
  • 1
  • 11
  • 29
  • I mean that as you mentioned in the question, the table said Java 3.0 agent hasn't supported azure web app, and it's true that we can't find any document to guide how to set agent in azure web app. If you feel it's helpful to you, could you pls mark it as the answer? Thanks in advance, and pls feel free to share your further problems if exists. – Tiny Wang Apr 08 '21 at 05:48
  • simply enabling app insights as shown in your screenshot doesn't work for me. I have also created an issue on [github](https://github.com/microsoft/ApplicationInsights-Java/issues/1615). They explained that the name of the deployed jar file should be "app.jar" and that I need to set the "XDT_MicrosoftApplicationInsights_Java" application setting. Does that correspond with your setup as well? – t.amsing Apr 08 '21 at 10:39
  • No, what heyams said is different from mine. When you deploy your springboot app to azure app service, you can open kudu and you'll see app.jar in the path D:/home/site/wwwroot, and as the doc which describes how to set appinsight-agent, you need to prepare `applicationinsights-agent-3.0.3.jar` and a setting json file. I aslo tried to upload this jar in kudu but it can't be saved in the jar format, so I think this is still not supported. By the way, my azure web app didn't use Tomcat as the container, I'll try it later. – Tiny Wang Apr 08 '21 at 14:55
  • Any way, according to [the doc](https://learn.microsoft.com/en-us/azure/azure-monitor/app/azure-web-apps?tabs=java#enable-application-insights) provided by heyams, it also mentioned that `Follow the guidelines for Application Insights Java 3.0 agent to enable auto-instrumentation for your Java apps without changing your code. The automatic integration is not yet available for App Service.` – Tiny Wang Apr 08 '21 at 14:56
  • It's no luck for me. I can't upload `applicationinsights-agent-3.0.2.jar` to app service. After I uploaded it, the directory turn to this https://i.stack.imgur.com/VYznr.png – Tiny Wang Apr 09 '21 at 02:52
  • if you just want to use 3.0.2, you don't have to manually upload it. It will just work when you add this application setting; XDT_MicrosoftApplicationInsights_Java -> 1 – t.amsing Apr 12 '21 at 09:24