Service identification in a cloud docker system

38 Views Asked by At

I got a system in Azure cloud which has a docker and each pod in the docker is a different service implemented with c# .Net Core. One of these services is a gRPC service which is a file service and every other service who want to access a file are using an SDK which access that service directly and it allows to access the requested file. The SDK is a nuget which every service adds to its references.

A flow example: Service A => invoke a method from SDK => Calls file service which access a file => return a response to the SDK => return a response to service A.

My desired behavior: I want to identify in the SDK the service itself which invokes the SDK's method. I can't use a simple input like just passing a string parameter because it's important to know the true service and I can't risk someone sending wrong information.

this is a pseudo code of what I need:

//this is an SDK method
public string GetSomeValueFromFile(string fileName)
{
    string invokingService = GetCurrentService();
    ...
    ...
}

And the question is how to implement this GetCurrentService() method since I have no idea where to start

0

There are 0 best solutions below