openzipkin / zipkin-gcp

Reporters and collectors for use in Google Cloud Platform
https://cloud.google.com/trace/docs/zipkin
Apache License 2.0
91 stars 54 forks source link

Add the query API #28

Open marcingrzejszczak opened 7 years ago

marcingrzejszczak commented 7 years ago

Hi! It would be really nice for the collector to provide the query API. Without this it's difficult to programmatically verify whether the stackdriver has received the spans properly.

In Sleuth I'm writing end to end tests (https://github.com/marcingrzejszczak/stackdriver-e2e) that are starting the collector, 2 applications and then are checking if after curling a request to one of them the Stackdriver has a proper trace in it. I wanted to do the query via a collector but there's no query api available since the span store in the stackdriver Zipkin collector doesn't allow reads.

Related issue - https://github.com/spring-cloud/spring-cloud-sleuth/issues/493

codefromthecrypt commented 7 years ago

I suppose that specifically, you are asking to flesh out StackdriverStorageComponent to include the read-back (query) api.

kevinmdavis commented 7 years ago

It would be nice for us to be able to support the entire Zipkin API, however there's a bit of a challenge with translating between the Zipkin and Stackdriver data models for supporting the query API.

In order to work correctly with Stackdriver's single-host spans, we currently split Zipkin multi-host spans into multiple Stackdriver single-host spans by rewriting some of the Zipkin span ID's. If we want the read and write API's to be symmetric, we'd likely need to store additional information (such as the original Zipkin ID) in the Stackdriver Trace in order to be able to perform the inverse operation when reading Zipkin traces.

Another alternative would be to not do any advanced translation on the read API and always return single-host Zipkin spans. This would make read and write asymmetric, but would be simpler to implement.

@adriancole Any thoughts?

In the meantime, you can also list Traces by using the Stackdriver Trace API directly, however this uses the Stackdriver data model, not the Zipkin data model: https://cloud.google.com/trace/api/reference/rest/v1/projects.traces/list

codefromthecrypt commented 7 years ago

starting with simple readbacks is probably best (even if asymetric) For example, it would progress things. We'd eventually need to address some translation/folding, but at worst case that could be localized in a test support class.

marcingrzejszczak commented 7 years ago

Any luck with this? :P

kevinmdavis commented 7 years ago

Not yet, but pull requests are welcome!

dpanyam commented 4 years ago

Hello All, I have a Node JS express app hosted on Google Cloud ( AppEngine standard to be specific). I want to forward traces from the native Cloud Tracing service available in Google Cloud to a Zipkin server that I set up to run as a docker container inside a VM in GCP. At present is it possible to forward traces from Cloud Tracing to Zipking?