Skip to content

Latest commit

 

History

History
81 lines (62 loc) · 3.78 KB

README.md

File metadata and controls

81 lines (62 loc) · 3.78 KB

module-storage-stackdriver

Overview

This is a 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 17+ is required to run Zipkin server.

Fetch the latest released executable jar for Zipkin server and 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.gcp:zipkin-module-gcp:LATEST:module gcp.jar
$ STORAGE_TYPE=stackdriver STACKDRIVER_PROJECT_ID=zipkin-demo \
    java \
    -Dloader.path='gcp.jar,gcp.jar!/lib' \
    -Dspring.profiles.active=gcp \
    -cp zipkin.jar \
    org.springframework.boot.loader.launch.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
STACKDRIVER_HTTP_LOGGING When set, controls the volume of HTTP logging of the Stackdriver Trace Api. Options are BASIC and HEADERS

Running

$ STORAGE_TYPE=stackdriver STACKDRIVER_PROJECT_ID=zipkin-demo STACKDRIVER_HTTP_LOGGING=basic\
    java \
    -Dloader.path='gcp.jar,gcp.jar!/lib' \
    -Dspring.profiles.active=gcp \
    -cp zipkin.jar \
    org.springframework.boot.loader.launch.PropertiesLauncher

Testing

Once your storage is enabled, verify it is running:

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