Home

Awesome

spannerz

spannerz adds an HTTP handler to your binary to report query plans from Google Cloud Spanner clients. You can use spannerz as a standalone binary too.

NOTE: You need Graphviz installed for visualization features.

Goals

Usage

Standalone binary:

$ go get -u github.com/rakyll/spannerz
$ spannerz -db projects/PROJECT/instances/SPANNER_INSTANCE/databases/SPANNER_DB

HTTP handler:

import (
    "cloud.google.com/go/spanner"
    "github.com/rakyll/spannerz/spannerz"
)

client, err := spanner.NewClient(ctx, "projects/PROJECT/instances/SPANNER_INSTANCE/databases/SPANNER_DB")
if err != nil {
    log.Fatalf("Cannot create Spanner client: %v", err)
}
http.Handle("/spannerz", &spannerz.Handler{
    Client: client,
})
log.Fatal(http.ListenAndServe(":9090", nil))

Screenshot

Roadmap

Disclaimer

This is not an official Google product.