Skip to content

jrkt/go-tracing-lab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tracing requests with Google Stackdriver

https://github.com/GoogleCloudPlatform/google-cloud-go/blob/master/trace/trace.go

This is an example repo for getting Google's Stackdriver Trace tracing requests across microservices.

Create new GCP project

Google Cloud Console

Enable billing

Go to Billing to set up a billing account & make sure it is enabled for the new project you created.

Enable Stackdriver Trace API

API Dashboard

  • click "Enable API"
  • search "trace"
  • select "Stackdriver Trace API"
  • click "Enable"

Create service account

Go to Service Accounts

  • click "Create service account"
  • name it "tracer"
  • select the Role of "Cloud Trace Agent"
  • select "Furnish a new private key"
  • click "CREATE"

The JSON key will be downloaded.

set environment vars

  export GCP_PROJECT={project id of the new project you created}

  export GCP_KEY={full path of the service account key file that you just downloaded}

Get repo

git clone http://github.com/jrkt/go-tracing-lab $GOPATH/src/github.com/jrkt/go-tracing-lab

HTTP REST Labs

Hello World
Silicon Valley Conversation

gRPC Labs

Hello World
Weather Search

Reference: Setting up gRPC (linux)

  • Get code
go get -u github.com/golang/protobuf/{proto,protoc-gen-go}
go get -u google.golang.org/grpc
  • Install protoc
wget https://github.com/google/protobuf/releases/download/v3.2.0rc2/protoc-3.2.0rc2-linux-x86_64.zip
unzip protoc-3.2.0rc2-linux-x86_64.zip
sudo cp bin/protoc /usr/local/bin

About

Example repo for tracing requests between microservices with Google's Stackdriver

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages