<p>I'm looking for a programmatic way to list up callers of one Service in kubernetes. For example, when there're 5 microservices  A, B, C, D and E, and microservice A is accessed by microservice B, C, D and E, I'd like to list up microservice B, C, D, and E (at least their namespaces).</p>

<p>It's possible to grep environment variables of all Deployment and find services that point to Service of A like <em>service-a.a-namespace.svc</em>. But, I'm finding a more reliable approach that takes advantage of kubernetes features like Servive, kube-dns, iptables, kubectl, and so on. Please help me if you know anything.</p>

Toshinori Sugita
<p>Well, this is something related to distributed tracing !!</p>

<p>You can initiate a GUID in the headers and supply it to the subsequent microservices calls.</p>

<p>And if you are using some stable frameworks like Spring and spring-cloud then you can use Zipkins for this.</p>

<p>The caller sends a unique GUID and is intercepted by all the microservices in the hierarchy.</p>

<p>And when you wanna visualise the logs, then you can search using this GUID and related URI calls will appear.</p>

<p>The other way is to use Jaeger based tracing and it has support for kubernetes too.</p>

<p>You can refer <a href="https://github.com/jaegertracing/jaeger-operator" rel="nofollow noreferrer">this link</a> for more.</p>

<p>I guess this turns a bit helpful</p>
