observability

package
v2.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2020 License: Apache-2.0 Imports: 5 Imported by: 6

Documentation

Overview

Package observability holds metrics and tracing recording implementations.

Index

Constants

View Source
const (
	// ClientSpanName is the key used to start spans from the client.
	ClientSpanName = "cloudevents.client"

	// ResultError is a shared result tag value for error.
	ResultError = "error"
	// ResultOK is a shared result tag value for success.
	ResultOK = "success"
)

Variables

View Source
var (
	// KeyMethod is the tag used for marking method on a metric.
	KeyMethod, _ = tag.NewKey("method")
	// KeyResult is the tag used for marking result on a metric.
	KeyResult, _ = tag.NewKey("result")
)

Functions

func EnableTracing

func EnableTracing(enabled bool)

EnableTracing is deprecated. Tracing is always enabled.

func LatencyTags

func LatencyTags() []tag.Key

LatencyTags returns all tags used for Latency measurements.

Types

type Observable

type Observable interface {
	MethodName() string
	LatencyMs() *stats.Float64Measure
}

Observable represents the the customization used by the Reporter for a given measurement and trace for a single method.

type Reporter

type Reporter interface {
	Error()
	OK()
}

Reporter represents a running latency counter. When Error or OK are called, the latency is calculated. Error or OK are only allowed to be called once.

func NewReporter

func NewReporter(ctx context.Context, on Observable) (context.Context, Reporter)

NewReporter creates and returns a reporter wrapping the provided Observable.

Jump to

Keyboard shortcuts

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