cloudrun_statshandler

package module
v0.0.0-...-d70d759 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 18, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

cloudrun_statshandler adds functionality to the OpenCensus gRPC plugin (go.opencensus.io/plugin/ocgrpc) for Google Cloud, specifically Cloud Run. It may work with other Google Cloud platforms as well.

We provide a wrapper around stats.Handler (google.golang.org/grpc/stats), which does two things: 1. Translates from the Google Cloud Platform trace ID header to the gRPC trace header 2. Adds the Cloud Run revision name to the go.opencensus.io/tag map, so that metrics reported by the OpenCensus gRPC plugin are tagged with it. That enables us to monitor A/B deployments.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Key for the opencensus metric tag. OpenCensus stores the tags in a tag map in the
	// context. The key name must be unique within the tag map.
	KeyRevisionName = tag.MustNewKey("cloud_run_revision_name")
)

Functions

func AddTagKeysToViews

func AddTagKeysToViews(views []*view.View)

AddTagKeysToViews adds the revision name and location name tags to the the list of go.opencensus.io/stats/view passed in.

func NewHandler

func NewHandler(h stats.Handler, revisionName string) stats.Handler

NewHandler returns a wrapper around a gRPC stats handler Provide the Cloud Run revision and location names

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL