Git Product home page Git Product logo

Comments (4)

yantang-msft avatar yantang-msft commented on June 13, 2024 1

@grassgit Depending on your VS SF tools version, the template may give you different initial code. I just tried with VS 2019 and it's actually asking you to override the listeners yourself: https://aka.ms/servicefabricservicecommunication
If you are calling the backend through Service Remoting, then take a look at this example: https://github.com/yantang-msft/service-fabric-application-insights-example/blob/master/StatelessBackend/StatelessBackend.cs

from applicationinsights-servicefabric.

yantang-msft avatar yantang-msft commented on June 13, 2024

@michalMajkel For remoting V1, it's actually saying use CorrelatingServiceProxyFactory, this is to make the automatic request/dependency telemetry collection work, but not make ServiceRemoting work. Basically it's a wrapper of ServiceProxy and collects the request/dependency telemetry for you.

The CorrelatingRemotingMessageHandler class exists in Microsoft.AI.ServiceFabric.Native.dll, under namespace Microsoft.ApplicationInsights.ServiceFabric.Remoting.Activities.

Let us know if it's still unclear to you, or you have any suggestion regarding the documentation.

from applicationinsights-servicefabric.

grassgit avatar grassgit commented on June 13, 2024

To add to this, configuration application insights for a service fabric statefull (or stateless) service using the latest version of service fabric (3.4) and sf ai (2.3) is not possible using the provided documentation. Specifically the section: https://github.com/microsoft/ApplicationInsights-ServiceFabric#net-core-1
Microsoft.ApplicationInsights.ServiceFabric.Native - For Service Fabric Reliable Services > .NET core

Some background. My goal is to create a simple SF application with a web API with a backing statefull service as a proof of concept. What I would like to see is that all action of the API and any backing services are tracked in the same request.
I have the ASPNET Core application configured with AI and this is sending the a request and the dependency call to the statefull service to AI. When I view the request in the portal I see two telemetry items.

The first issue is code example shows the method to be updated as CreateServiceInstanceListeners this does not exist the closest match is CreateServiceReplicaListeners which appears to be only a name change; so this is not a big problem.
The second issue is where it all goes wrong. The example uses WebListenerCommunicationListener which is an ASPNET .Core class. The class as included in the VS template for a statefull service FabricTransportServiceRemotingListener this does not provide any options to do the configuration as there are using OWIN . The problem here is that the native package does not seem to contain any method to obtain a telemetry client or add/read correlations ids and such from remoting client. The ASPNET .Core approach is not possible because the this remoting listener works completely different the controller approach.

I have tried to get things to work but so far I cannot get it to work. Creating the telemetry initializer in
Creating the initializer with the listener is not an issue, but I cannot actually use this in one of the statefull services' methods. Using an instance or static variable just seems wrong, since the containing class is not specific to a request but reused by multiple (concurrent) calls. I have found ways add context information to the remoting context but again no way of passing this information into the method being called.

Does anyone have suggestions how to get this to work in the current version without changing the service to an ASPNET .Core service?

from applicationinsights-servicefabric.

grassgit avatar grassgit commented on June 13, 2024

Thanks this is exactly what I was looking for. The main readme only contains examples for use with AspNet Core which has a lot more infrastructure.

from applicationinsights-servicefabric.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.