metrics

package
v0.0.0-...-d19fc40 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

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

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

func AddTargetTags

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

func EventTypeMetricValue

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

func StartEventProcessing(ctx context.Context) context.Context

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

Types

type BrokerCellLatencyReporter

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

func NewBrokerCellLatencyReporter

func NewBrokerCellLatencyReporter() (*BrokerCellLatencyReporter, error)

NewBrokerCellLatencyReporter creates a new BrokerCellLatencyReporter

func (*BrokerCellLatencyReporter) ReportLatency

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

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

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

func (*DeliveryReporter) FinishEventProcessing

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 {
	Namespace    string
	Broker       string
	EventType    string
	ResponseCode int
}

type IngressReporter

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

StatsReporter reports ingress metrics.

func NewIngressReporter

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

NewIngressReporter creates a new StatsReporter.

func (*IngressReporter) ReportEventCount

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