Skip to content

Latest commit

 

History

History
 
 

storage-stackdriver

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

autoconfigure-storage-stackdriver

Overview

This is a Spring Boot AutoConfiguration module that can be added to a Zipkin Server deployment to send Spans to Google Stackdriver Trace over gRPC transport.

This currently only supports sending to Stackdriver, not reading back spans from the service. Internally this module wraps the StackdriverStorage and exposes configuration options through environment variables.

Experimental

  • Note: This is currently experimental! *
  • Note: This requires reporters send 128-bit trace IDs *
  • Check openzipkin/b3-propagation#6 for tracers that support 128-bit trace IDs

Quick start

JRE 8 is required to run Zipkin server.

Fetch the latest released executable jar for Zipkin server and autoconfigure module jar for stackdriver storage. Run Zipkin server with the StackDriver Storage enabled.

For example:

$ curl -sSL https://zipkin.io/quickstart.sh | bash -s
$ curl -sSL https://zipkin.io/quickstart.sh | bash -s io.zipkin.java:zipkin-autoconfigure-storage-stackdriver:LATEST:module stackdriver.jar
$ STORAGE_TYPE=stackdriver STACKDRIVER_PROJECT_ID=zipkin-demo \
    java \
    -Dloader.path='stackdriver.jar,stackdriver.jar!/lib' \
    -Dspring.profiles.active=stackdriver \
    -cp zipkin.jar \
    org.springframework.boot.loader.PropertiesLauncher

After executing these steps, applications can send spans http://localhost:9411/api/v2/spans (or the legacy endpoint http://localhost:9411/api/v1/spans)

The Zipkin server can be further configured as described in the Zipkin server documentation.

Configuration

Configuration can be applied either through environment variables or an external Zipkin configuration file. The module includes default configuration that can be used as a reference for users that prefer a file based approach.

Environment Variables

Environment Variable Value
GOOGLE_APPLICATION_CREDENTIALS Optional. Google Application Default Credentials. Not managed by spring boot.
STACKDRIVER_PROJECT_ID GCP projectId. Optional on GCE. Required on all other platforms. If not provided on GCE, it will default to the projectId associated with the GCE resource.
STACKDRIVER_API_HOST host:port combination of the gRPC endpoint. Default: cloudtrace.googleapis.com:443

Running

STORAGE_TYPE=stackdriver
java -Dloader.path=stackdriver -Dspring.profiles.active=stackdriver -cp zipkin.jar org.springframework.boot.loader.PropertiesLauncher

Testing

Once your storage is enabled, verify it is running:

$ curl -s localhost:9411/health|jq .zipkin.details.StackdriverStorage
{
  "status": "UP"
}