commonmetrics

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2023 License: Apache-2.0 Imports: 4 Imported by: 6

Documentation

Index

Constants

View Source
const (
	// OperationLatencyKeyMilliseconds is the key for soci operation latency metrics in milliseconds.
	OperationLatencyKeyMilliseconds = "operation_duration_milliseconds"

	// OperationLatencyKeyMicroseconds is the key for soci operation latency metrics in microseconds.
	OperationLatencyKeyMicroseconds = "operation_duration_microseconds"

	// OperationCountKey is the key for soci operation count metrics.
	OperationCountKey = "operation_count"

	// BytesServedKey is the key for any metric related to counting bytes served as the part of specific operation.
	BytesServedKey = "bytes_served"

	// ImageOperationCountKey is the key for any metric related to operation count metric at the image level (as opposed to layer).
	ImageOperationCountKey = "image_operation_count_key"
)
View Source
const (
	// prometheus metrics
	Mount             = "mount"
	RemoteRegistryGet = "remote_registry_get"
	NodeReaddir       = "node_readdir"
	InitMetadataStore = "init_metadata_store"
	SynchronousRead   = "synchronous_read"
	BackgroundFetch   = "background_fetch"

	SynchronousReadCount              = "synchronous_read_count"
	SynchronousReadRegistryFetchCount = "synchronous_read_remote_registry_fetch_count" // TODO revisit (wrong place)
	SynchronousBytesServed            = "synchronous_bytes_served"

	// fuse operation failure metrics
	FuseNodeGetattrFailureCount     = "fuse_node_getattr_failure_count"
	FuseNodeListxattrFailureCount   = "fuse_node_listxattr_failure_count"
	FuseNodeLookupFailureCount      = "fuse_node_lookup_failure_count"
	FuseNodeOpenFailureCount        = "fuse_node_open_failure_count"
	FuseNodeReaddirFailureCount     = "fuse_node_readdir_failure_count"
	FuseFileReadFailureCount        = "fuse_file_read_failure_count"
	FuseFileGetattrFailureCount     = "fuse_file_getattr_failure_count"
	FuseWhiteoutGetattrFailureCount = "fuse_whiteout_getattr_failure_count"
	FuseUnknownFailureCount         = "fuse_unknown_operation_failure_count"

	// TODO this metric is not available now. This needs to go down to BlobReader where the actuall http call is issued
	SynchronousBytesFetched = "synchronous_bytes_fetched"

	// Number of times the snapshotter falls back to use a normal overlay mount instead of mounting the layer as a FUSE mount.
	// Note that a layer not having a ztoc is NOT classified as an error, even though `fs.Mount` returns an error in that case.
	FuseMountFailureCount = "fuse_mount_failure_count"

	// Number of errors of span fetch by background fetcher
	BackgroundSpanFetchFailureCount = "background_span_fetch_failure_count"

	// Number of spans fetched by background fetcher
	BackgroundSpanFetchCount = "background_span_fetch_count"

	// Number of items in the work queue of background fetcher
	BackgroundFetchWorkQueueSize = "background_fetch_work_queue_size"
)

Lists all metric labels.

Variables

This section is empty.

Functions

func AddBytesCount

func AddBytesCount(operation string, layer digest.Digest, bytes int64)

AddBytesCount wraps the labels attachment as well as calling Add into a single method.

func AddImageOperationCount

func AddImageOperationCount(operation string, image digest.Digest, count int32)

AddImageOperationCount wraps the labels attachment as well as calling Add into a single method.

func IncOperationCount

func IncOperationCount(operation string, layer digest.Digest)

IncOperationCount wraps the labels attachment as well as calling Inc into a single method.

func MeasureLatencyInMicroseconds

func MeasureLatencyInMicroseconds(operation string, layer digest.Digest, start time.Time)

MeasureLatencyInMicroseconds wraps the labels attachment as well as calling Observe into a single method. Right now we attach the operation and layer digest, so it's possible to see the breakdown for latency by operation and individual layers. If you want this to be layer agnostic, just pass the digest from empty string, e.g. layerDigest := digest.FromString("")

func MeasureLatencyInMilliseconds

func MeasureLatencyInMilliseconds(operation string, layer digest.Digest, start time.Time)

MeasureLatencyInMilliseconds wraps the labels attachment as well as calling Observe into a single method. Right now we attach the operation and layer digest, so it's possible to see the breakdown for latency by operation and individual layers. If you want this to be layer agnostic, just pass the digest from empty string, e.g. layerDigest := digest.FromString("")

func Register

func Register()

Register registers metrics. This is always called only once.

Types

This section is empty.

Jump to

Keyboard shortcuts

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