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 55 forks source link

README clarifications #74

Open codefromthecrypt opened 6 years ago

codefromthecrypt commented 6 years ago

per https://github.com/openzipkin/zipkin-gcp/issues/42#issuecomment-379859937

We should highlight that this code (which ends up in the openzipkin/zipkin-gcp docker image) replaces the preceding gcr.io/stackdriver-trace-docker/zipkin-collector, but it is different. Primarily, the stackdriver module here is a server extension, not enabled by default. We should also note the oauth scope required for stackdriver quite loudly

https://www.googleapis.com/auth/trace.append oauth scope is required

translation from old to new:

kubectl run zipkin-collector --image=gcr.io/stackdriver-trace-docker/zipkin-collector --expose --port=9411
kubectl run zipkin-gcp --image=openzipkin/zipkin-gcp --env="STORAGE_TYPE=stackdriver" --expose --port=9411

Thanks for the advice @jsw

jsw commented 6 years ago

Also note that thankfully I did not need to specify GOOGLE_APPLICATION_CREDENTIALS or STACKDRIVER_PROJECT_ID, as expected as those should be inferred from GKE. Or maybe it's the case that I could configure those to send to a different Stackdriver account than the one associated with the current cluster.

I'd also expect STORAGE_TYPE=stackdriver to be a default given what I thought the primary use case for this image is, but based on your previous comments, I'm guessing that may not always be the case?

codefromthecrypt commented 6 years ago

I'd still hesitate on stackdriver being default.. Imagine when we have support for Google Pub/Sub collector. When that occurs it becomes more obvious why choosing a default could be problematic. For example, in zipkin-aws we have xray available, but off by default as well. There are SQS and Kinesis components there.

jsw commented 6 years ago

Makes sense. Perhaps the point of the gcr.io/stackdriver-trace-docker/zipkin-collector image is to set stackdriver as the storage? I'm not sure where the associated Dockerfile for that is.

codefromthecrypt commented 6 years ago

Makes sense. Perhaps the point of the gcr.io/stackdriver-trace- docker/zipkin-collector image to set stackdriver as the storage? I'm not sure where the associated Dockerfile for that is.

There's some history perhaps missing here. The image here is the successor to the "zipkin-collector" one. Formerly, it was a custom image so supported less features (ex Kafka). I suspect @mtwo or @saturnism or someone with access will update the canonical docs later.

codefromthecrypt commented 6 years ago

@saturnism @mtwo (or anyone else) do one of you know how to verify an account?

@zachdaniel mentioned this: In kubernetes getting PERMISSION_DENIED: The caller does not have permission, but I checked and those oauth scopes are granted on the cluster.

I tried to verify what we have and I can't seem to figure it out.

Ex I googled around enough to figure out how to get gcloud installed

brew install caskroom/cask/google-cloud-sdk

I associated it with our account etc.

Then I found this doc to try to see permissions for the service account I use:

16:55 $ gcloud iam service-accounts describe stackdriver-zipkin@zipkin-demo.iam.gserviceaccount.com
displayName: stackdriver-zipkin
email: stackdriver-zipkin@zipkin-demo.iam.gserviceaccount.com
etag: BwVAn_6DdwA=
name: projects/zipkin-demo/serviceAccounts/stackdriver-zipkin@zipkin-demo.iam.gserviceaccount.com
oauth2ClientId: '103291061020214604728'
projectId: zipkin-demo
uniqueId: '103291061020214604728'
✔ ~/Downloads 
16:58 $ gcloud iam service-accounts get-iam-policy stackdriver-zipkin@zipkin-demo.iam.gserviceaccount.com
etag: ACAB

Basically I see nothing that I could use to help @zachdaniel troubleshoot his access, as I don't know how to even verify mine. Whatever we end up with should likely go into a troubleshooting section.

mtwo commented 6 years ago

Either Ray or myself can update the docs whenever you wish, just say the word!

I assume that @zachdaniel is using GKE? In that case, the project scope selection is automatic and there's no need to specify a service account or configure anything. However, the Trace API isn't enabled by default - I'm guessing it needs to be enabled and then the errors will go away.

zachdaniel commented 6 years ago

@mtwo that is correct, that was all I needed :)

zachdaniel commented 6 years ago

Actually I also needed to ensure the service account had write permissions to the Trace API as well, sorry.

mtwo commented 6 years ago

@adriancole should I update the GCP docs to point at the new container images? Happy to make the changes if everything is good to go

codefromthecrypt commented 6 years ago

Yes please do! Note the STORAGE_TYPE variable needs to be set to stackdriver

On Wed, 11 Apr 2018, 23:26 Morgan McLean, notifications@github.com wrote:

@adriancole https://github.com/adriancole should I update the GCP docs to point at the new container images? Happy to make the changes if everything is good to go

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/openzipkin/zipkin-gcp/issues/74#issuecomment-380493551, or mute the thread https://github.com/notifications/unsubscribe-auth/AAD617ZbiQY21tpDBRFnkZHdvjTrE4K5ks5tniCogaJpZM4TNamg .

mtwo commented 6 years ago

Right now our docs cover how to get this working via container within GCP, container outside of GCP, or as a .jar. I'm going to keep the container-focused sections and will direct people who want .jar instructions to the documentation here on GitHub.

Sound okay?

codefromthecrypt commented 6 years ago

sgtm

jsw commented 6 years ago

@mtwo @adriancole Per Google's documentation

Zipkin tracers and the Stackdriver Trace instrumentation libraries can't append spans to the same traces, meaning that traces that are captured in one library won't contain spans for services instrumented in the other type of library... This is because Zipkin and Stackdriver Trace use different formats for propagating trace context between services.

Is there any work being done to resolve this limitation?

codefromthecrypt commented 6 years ago

yep census is the replacement for stackdriver instrumentation moving forward. It uses B3 by default now https://github.com/census-instrumentation/opencensus-specs/blob/master/trace/HTTP.md#propagation

jsw commented 6 years ago

Nice. I guess the documentation can't quite be updated to reflect that as it looks like the transition to OpenCensus is there for Java, but not, for example, JavaScript, based on what these links go to

https://cloud.google.com/trace/docs/client-libraries

I did find this, but it has no releases, and doesn't seem to be linked to from opencensus.io

https://github.com/census-instrumentation/opencensus-js-core

toredash commented 3 years ago

Hi,

I was wondering what the status is on the updates to the docs ? I'm having a hard time to identify what images and ENV are required to make this work when running on GKE / GCP.

I'm able to get image gcr.io/stackdriver-trace-docker/zipkin-collector working, but then I need to specify env PROJECT_ID, but I don't see that documented anywhere.

And using the image openzipkin/zipkin-gcp with env STORAGE_TYPE does not work, but thats the one google has documented.