openzipkin / zipkin-api

Zipkin's language independent model and HTTP Api Definitions
https://zipkin.io/zipkin-api/
Apache License 2.0
59 stars 32 forks source link

Feature request- API to get all services links by using a traceId #97

Open metalhead44 opened 2 years ago

metalhead44 commented 2 years ago

Hello,

Today, I could use the dependencies api to get the services link by inputting a timestamp value but it is very tedious to get the exact timestamp. We want to use the trace data to derive service links for a particular traceId. This will be of more value as we will be tagging custom attribute to the trace data like business identifiers like customerId and then using this customerId to get the traceId and then get the links of all services involved in the transaction.

Is there any appetite to add this feature to get service links based on a traceid pls? Or if someone can guide me how to do it easily or if someone already did it before?

This will come specially handy in building lineage of data in the database for a business transactions. for example - I can decide to drop all data for prospect customers after 6 months from database if their status is "LOST Opportunity". But in a big system, one may not know which all services are involved and how to clear data from 10-15 databases. Hope this makes sense on why I need such a capability. Thanks!!

jcchavezs commented 2 years ago

I think you can do that with the Kafka driver for dependencies cc @jeqo

On Thu, 28 Jul 2022, 17:28 metalhead44, @.***> wrote:

Hello,

Today, I could use the dependencies api to get the services link by inputting a timestamp value but it is very tedious to get the exact timestamp. We want to use the trace data to derive service links for a particular traceId. This will be of more value as we will be tagging custom attribute to the trace data like business identifiers like customerId and then using this customerId to get the traceId and then get the links of all services involved in the transaction.

Is there any appetite to add this feature to get service links based on a traceid pls? Or if someone can guide me how to do it easily or if someone already did it before?

This will come specially handy in building lineage of data in the database for a business transactions. for example - I can decide to drop all data for prospect customers after 6 months from database if their status is "LOST Opportunity". But in a big system, one may not know which all services are involved and how to clear data from 10-15 databases. Hope this makes sense on why I need such a capability. Thanks!!

— Reply to this email directly, view it on GitHub https://github.com/openzipkin/zipkin-api/issues/97, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAXOYAUGRHZB46OMBHSGL6LVWKRKFANCNFSM545WQVJQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

metalhead44 commented 2 years ago

I figured a way to do it on my own way. Basically , I will be using the trace/{traceId} endpoint to get the relevant trace. Then using the JSONPath library get all the servicenames by using the expression. - $[*].localEndpoint.serviceName. This seems to be working just that, I will need to build my own API to get this information. I can probably try to raise a pull request if this is going to help wider community.

the endpoint could be trace/{traceid}/services

Thoughts ?