1
votes

I've built a web API that receives GET requests and processes an image based on specifications passed in like image Url, text to be drawn over it, quality, size, etc.

I have a few questions about using Application Insights, which seems to be built right into my Visual Studio IDE and also Azure.. This question was sparked after viewing this source in my research for the right form of usage analytics:

https://docs.microsoft.com/en-us/azure/application-insights/app-insights-overview

Questions:

1) Does it require any new code to be used?

2) Can it track individual parameters (image, size, etc.) so we can see, for example, which images are used most often, what sizes images are requested at, etc.?

3) Can we also use it to log custom events that don't neatly map to separate methods or api endpoints? (e.g. log each time we draw a text field, measure a string, load a font, or pull an image from blob storage)

I would really appreciate an answer that could cover my more broad concerns like these about choosing a usage analytics tool. Any suggestions as to what other tools Azure has for these sorts of requirements would also be great.

Thanks for taking the time to read!

1

1 Answers

2
votes

Regarding to the first question the answer is: It depends. How and where is you web api hosted. In IIS? On Azure? Using self hosting?

According to the documentation found here https://docs.microsoft.com/en-us/azure/application-insights/app-insights-monitor-performance-live-website-now these are your options:

You can instrument a live web app with Azure Application Insights, without having to modify or redeploy your code. In your apps are hosted by an on-premises IIS server, you install Status Monitor; or if they're Azure web apps or run in an Azure VM, you can install the Application Insights extension. (There are also separate articles about instrumenting live J2EE web apps and Azure Cloud Services.)

But when it comes to your other questions, you will need to add some code by using the SDK. You can then track custom traces (log messages for example), custom metrics (like counts of image sizes). See https://docs.microsoft.com/en-us/azure/application-insights/app-insights-api-custom-events-metrics:

The Azure Application Insights core telemetry API lets you send custom events and metrics, and your own versions of standard telemetry. This API is the same API that is used by the standard Application Insights data collectors.

Using this SDK you can add custom properties to any telemetry item you collect, next to the properties provided by the event definition.

Now, not only will AI present you with a dashboard to get a quick glance of your app status, it also has a very powerful query tool you can use: https://docs.microsoft.com/en-us/azure/application-insights/app-insights-analytics

So yes, I would say that everything you describe can be done with AI. Since you can expirement with it for free I would say give it a go since getting it up and running is quite easy.