microsoft / ApplicationInsights-ServiceFabric

ApplicationInsights SDK for ServiceFabric projects
MIT License
63 stars 26 forks source link

How to configure on stateless remoting v2 service #69

Closed vitorrossetto2 closed 6 years ago

vitorrossetto2 commented 6 years ago

Hi,

Even reading the documentation i could not figure out where i have to configure the telemetry client to monitor my stateless project with remoting v2.

It don't have a WebHostBuilder to UseApplicationInsights() and services.AddApplicationInsightsTelemetry(chaveInstrumentacaoApplicationInsights);

please help me!

Thanks.

yantang-msft commented 6 years ago

@vitorrossetto2 Checkout this example and see if it helps. https://github.com/yantang-msft/service-fabric-application-insights-example/blob/master/StatelessBackend/StatelessBackend.cs#L30

vitorrossetto2 commented 6 years ago

Hi,

Thank you, i managed to make it work with this tip but it still dont map the database requests =(

any idea what is happening?

here is the print of application map:

https://ibb.co/iYdMqo

thank you so much

yantang-msft commented 6 years ago

@vitorrossetto2 What do you mean by "map the database requests"? Do you mean you are calling sql database but the sql db node is not showing up?

vitorrossetto2 commented 6 years ago

yes, these microservices are making requests to sql server databases via dapper and entity framework but the nodes dont appear in application insights.

yantang-msft commented 6 years ago

The example only added the SF specific modules (that tracks the Service Remoting calls). The sql requests are more general dependency calls and they are captured by the DependencyCollectorModule. If you add the AI AspNetCore package, it will bring in that module automatically. I've updated my example, checkout the StatelessBackend service to see how it is setup.

vitorrossetto2 commented 6 years ago

Hi, i managed to do the configuration without transforming my stateless project into a stateless web api project following this link https://docs.microsoft.com/pt-br/azure/application-insights/application-insights-console. Can i fork your repo and make a pull request to adjust it?

thank you so much for the attention.

yantang-msft commented 6 years ago

@vitorrossetto2 Sure, that would be awesome!