microsoft / service-fabric

Service Fabric is a distributed systems platform for packaging, deploying, and managing stateless and stateful distributed applications and containers at large scale.
https://docs.microsoft.com/en-us/azure/service-fabric/
MIT License
3.03k stars 401 forks source link

Sharing information in service remoting requests without passing as parameter #183

Open WhitWaldo opened 6 years ago

WhitWaldo commented 6 years ago

Given that it's useful to see associated telemetry in Application Insights and those require a shared parent operation identifier, is there any way to send information with Service Remoting outside of the parameters for each service method? For example, if I'm sending data in an HTTP request to a controller method in ASP.NET Core, I may include additional information within the headers without actually having to specify it in a parameter in that method.

Is there any similar method to share information in Service Remoting requests without passing it all explicitly into the parameters of each method?

I used the example of App Insights, but there's other information I may want to pass between services as well, so simply using the correlation functionality in the Service Fabric App Insights package isn't sufficient for my purposes.

Thank you!

WhitWaldo commented 6 years ago

Following up on this, the Application Insights Service Fabric Native package actually includes a ServiceRemotingHeaderUtilities class to extend service remoting to include headers to pass alongside requests. Unfortunately, it's marked as internal, so I can't access it myself without making my own extension class.

Could this functionality be included directly in the Service Fabric itself given the usefulness of passing data between services without explicitly providing a parameter to that end?