1

At the moment I have about 10 microservices in my domain model. Each microservice includes the app insights sdk and the logs just push to app insights.

I have a customer of mine who has specifically requested that all microservices should go through like a app insights common microservice which would then push to app insights.

Lets just ignore that they are introducing a single point of failure for a sec. I want to know if the above is actually possible? Is the above suggestion a valid pattern? In the common Microservice would I be able to write a method in a class like ...

public void logBusinessEvent(String eventRequest,eventMessage){
    AppInsights ai = new AppInsights();
    ai.logRequests(eventRequest);
    ai.logTraces(eventTraces);
}

This feels very wrong but nether the less I want to do my homework on this before I get back with a response.

thanks

Richie
  • 4,989
  • 24
  • 90
  • 177
  • Thing is, this will probably break your correlation due to newly generated operationIds etc. What is the reason the customer gave for this? – Peter Bons Oct 15 '20 at 07:40
  • They want a log utility microservice because based on the type of log event, they may want to push to event hub as well. The job of that microservice is to kind of read the type of log event and then do a set of tasks based on the log. I would normally recommend something like fluentbit for this. But like I said I want to do my homework on suggested solution first – Richie Oct 15 '20 at 07:57
  • I would still send it directly to app insigths, then set up [continuous export](https://learn.microsoft.com/en-us/azure/azure-monitor/app/export-telemetry) and do the set of tasks based on the exports – Peter Bons Oct 15 '20 at 08:00

1 Answers1

1

I agree with Peter's option. In that way, it will break the correlation.

We'd better send it directly to application insights, and set up Continuous export, then do the set of tasks based on the exports.