monitoring

package
v0.0.0-...-bf8e85a Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package monitoring is responsible for uploading metrics to a monitoring service that supports OpenCensus.

Index

Constants

This section is empty.

Variables

View Source
var (

	// ActionCount is a metric for tracking the number of actions in reproxy.
	ActionCount = stats.Int64("rbe/action/count", "Number of actions processed by reproxy", stats.UnitDimensionless)
	// ActionLatency is a metric for tracking the e2e latency of an action in reproxy.
	ActionLatency = stats.Float64("rbe/action/latency", "Time spent processing an action e2e in reproxy", stats.UnitMilliseconds)
	// BuildCacheHitRatio is a metric of the ratio of cache hits in a build.
	BuildCacheHitRatio = stats.Float64("rbe/build/cache_hit_ratio", "Ratio of cache hits in a build", stats.UnitDimensionless)
	// BuildLatency is a metric for tracking the e2e latency of a build in reproxy.
	BuildLatency = stats.Float64("rbe/build/latency", "Time spent between reproxy receiving the first and last actions of the build", stats.UnitSeconds)
	// BuildCount is a metric for tracking the number of builds.
	BuildCount = stats.Int64("rbe/build/count", "Counter for builds", stats.UnitDimensionless)
	// BootstrapStartupLatency is a metric for tracing the critical path time of starting reproxy with bootstrap.
	BootstrapStartupLatency = stats.Int64("rbe/build/bootstrap_startup_latency", "Time spent starting reproxy with bootstrap", stats.UnitMilliseconds)
	// BootstrapShutdownLatency is a metric for tracing the critical path time of shutting down reproxy with bootstrap.
	BootstrapShutdownLatency = stats.Int64("rbe/build/bootstrap_shutdown_latency", "Time spent shutting down reproxy with bootstrap", stats.UnitMilliseconds)
)

Functions

func CleanLogDir

func CleanLogDir(logDir string)

CleanLogDir removes stray log files which may cause confusion when bootstrap starts

func SetupViews

func SetupViews(labels map[string]string) error

SetupViews sets up monitoring views. This can only be run once.

Types

type Exporter

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

Exporter is a type used to construct a monitored resource.

func NewExporter

func NewExporter(ctx context.Context, project, prefix, namespace string, ts *oauth.TokenSource) (*Exporter, error)

NewExporter returns a new Cloud monitoring metrics exporter.

func (*Exporter) Close

func (e *Exporter) Close()

Close stops the metrics exporter and waits for the exported data to be uploaded.

func (*Exporter) ExportActionMetrics

func (e *Exporter) ExportActionMetrics(ctx context.Context, r *lpb.LogRecord, remoteDisabled bool)

ExportActionMetrics exports metrics for one log record to opencensus.

func (*Exporter) ExportBuildMetrics

func (e *Exporter) ExportBuildMetrics(ctx context.Context, sp *spb.Stats)

ExportBuildMetrics exports overall build metrics to opencensus.

func (*Exporter) MonitoredResource

func (e *Exporter) MonitoredResource() (resType string, labels map[string]string)

MonitoredResource returns resource type and resource labels for the build.

Jump to

Keyboard shortcuts

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