metrics

package
v0.18.3 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2021 License: Apache-2.0 Imports: 14 Imported by: 8

Documentation

Index

Constants

View Source
const LatencyMetricName string = "brokercell_delay"

Variables

View Source
var (
	// Create the tag keys that will be used to add tags to our measurements.
	// Tag keys must conform to the restrictions described in
	// go.opencensus.io/tag/validate.go. Currently those restrictions are:
	// - length between 1 and 255 inclusive
	// - characters are printable US-ASCII
	NamespaceNameKey = tag.MustNewKey(metricskey.LabelNamespaceName)

	BrokerNameKey        = tag.MustNewKey(metricskey.LabelBrokerName)
	EventTypeKey         = tag.MustNewKey(metricskey.LabelEventType)
	ResourceKindKey      = tag.MustNewKey(labelResourceKind)
	ResourceNameKey      = tag.MustNewKey(labelResourceName)
	TriggerNameKey       = tag.MustNewKey(metricskey.LabelTriggerName)
	TriggerFilterTypeKey = tag.MustNewKey(metricskey.LabelFilterType)

	ResponseCodeKey      = tag.MustNewKey(metricskey.LabelResponseCode)
	ResponseCodeClassKey = tag.MustNewKey(metricskey.LabelResponseCodeClass)

	PodNameKey       = tag.MustNewKey(metricskey.PodName)
	ContainerNameKey = tag.MustNewKey(metricskey.ContainerName)
)

Functions

func AddRespStatusCodeTags added in v0.17.0

func AddRespStatusCodeTags(ctx context.Context, responseCode int) (context.Context, error)

func AddTargetTags added in v0.16.0

func AddTargetTags(ctx context.Context, target *config.Target) (context.Context, error)

func EventTypeMetricValue added in v0.16.0

func EventTypeMetricValue(eventType string) string

Stackdriver has a limit on the cardinality of fields on a metric, and event types can be any custom string. We're reducing the allowable values on this field to be limited to GCP event types and defaulting everything else to "custom".

func StartEventProcessing added in v0.16.0

func StartEventProcessing(ctx context.Context) context.Context

StartEventProcessing records the start of event processing for delivery within the given context.

Types

type BrokerCellLatencyReporter added in v0.17.0

type BrokerCellLatencyReporter struct {
	// contains filtered or unexported fields
}

func NewBrokerCellLatencyReporter added in v0.17.0

func NewBrokerCellLatencyReporter() (*BrokerCellLatencyReporter, error)

NewBrokerCellLatencyReporter creates a new BrokerCellLatencyReporter

func (*BrokerCellLatencyReporter) ReportLatency added in v0.17.0

func (r *BrokerCellLatencyReporter) ReportLatency(ctx context.Context, duration time.Duration, resourceKind, resourceName, namespace string) error

ReportLatency records the value to the latency metric

type ContainerName

type ContainerName string

type DeliveryMetricsKey added in v0.16.0

type DeliveryMetricsKey int

type DeliveryReporter

type DeliveryReporter struct {
	// contains filtered or unexported fields
}

func NewDeliveryReporter

func NewDeliveryReporter(podName PodName, containerName ContainerName) (*DeliveryReporter, error)

NewDeliveryReporter creates a new DeliveryReporter.

func (*DeliveryReporter) AddTags added in v0.16.0

func (r *DeliveryReporter) AddTags(ctx context.Context) (context.Context, error)

func (*DeliveryReporter) FinishEventProcessing added in v0.16.0

func (r *DeliveryReporter) FinishEventProcessing(ctx context.Context) error

FinishEventProcessing captures event processing times. Requires StartDelivery to have been called previously using ctx.

func (*DeliveryReporter) ReportEventDispatchTime

func (r *DeliveryReporter) ReportEventDispatchTime(ctx context.Context, d time.Duration)

ReportEventDispatchTime captures dispatch times.

type IngressReportArgs

type IngressReportArgs struct {
	EventType    string
	ResponseCode int
}

type IngressReporter

type IngressReporter struct {
	// contains filtered or unexported fields
}

IngressReporter reports ingress metrics.

func NewIngressReporter

func NewIngressReporter(podName PodName, containerName ContainerName) (*IngressReporter, error)

NewIngressReporter creates a new StatsReporter.

func (*IngressReporter) ReportEventCount added in v0.16.0

func (r *IngressReporter) ReportEventCount(ctx context.Context, args IngressReportArgs) error

type PodName

type PodName string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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