gocloud.dev: gocloud.dev/internal/oc Index | Files

package oc

import "gocloud.dev/internal/oc"

Package oc supports OpenCensus tracing and metrics for the Go Cloud Development Kit.

Index

Package Files

metrics.go trace.go

Variables

var (
    MethodKey   = mustKey("gocdk_method")
    StatusKey   = mustKey("gocdk_status")
    ProviderKey = mustKey("gocdk_provider")
)

Tag keys used for the standard Go CDK views.

func LatencyMeasure Uses

func LatencyMeasure(pkg string) *stats.Float64Measure

LatencyMeasure returns the measure for method call latency used by Go CDK APIs.

func ProviderName Uses

func ProviderName(driver interface{}) string

ProviderName returns the name of the provider associated with the driver value. It is intended to be used to set Tracer.Provider. It actually returns the package path of the driver's type.

func Views Uses

func Views(pkg string, latencyMeasure *stats.Float64Measure) []*view.View

Views returns the views supported by Go CDK APIs.

type Tracer Uses

type Tracer struct {
    Package        string
    Provider       string
    LatencyMeasure *stats.Float64Measure
}

A Tracer supports OpenCensus tracing and latency metrics.

func (*Tracer) End Uses

func (t *Tracer) End(ctx context.Context, err error)

End ends a span with the given error, and records a latency measurement.

func (*Tracer) Start Uses

func (t *Tracer) Start(ctx context.Context, methodName string) context.Context

Start adds a span to the trace, and prepares for recording a latency measurement.

Package oc imports 10 packages (graph) and is imported by 5 packages. Updated 2019-06-06. Refresh now. Tools for package owners.