Back to godoc.org

Package metric

v0.0.0-...-bb4cff5
Latest Go to latest

The latest major version is .

Published: today | License: Apache-2.0 | Module: google.golang.org/genproto

Index

Variables

var (
	MetricDescriptor_MetricKind_name = map[int32]string{
		0: "METRIC_KIND_UNSPECIFIED",
		1: "GAUGE",
		2: "DELTA",
		3: "CUMULATIVE",
	}
	MetricDescriptor_MetricKind_value = map[string]int32{
		"METRIC_KIND_UNSPECIFIED": 0,
		"GAUGE":                   1,
		"DELTA":                   2,
		"CUMULATIVE":              3,
	}
)

Enum value maps for MetricDescriptor_MetricKind.

var (
	MetricDescriptor_ValueType_name = map[int32]string{
		0: "VALUE_TYPE_UNSPECIFIED",
		1: "BOOL",
		2: "INT64",
		3: "DOUBLE",
		4: "STRING",
		5: "DISTRIBUTION",
		6: "MONEY",
	}
	MetricDescriptor_ValueType_value = map[string]int32{
		"VALUE_TYPE_UNSPECIFIED": 0,
		"BOOL":                   1,
		"INT64":                  2,
		"DOUBLE":                 3,
		"STRING":                 4,
		"DISTRIBUTION":           5,
		"MONEY":                  6,
	}
)

Enum value maps for MetricDescriptor_ValueType.

var File_google_api_metric_proto protoreflect.FileDescriptor

type Metric

type Metric struct {
	Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"`

	Labels map[string]string "" /* 153 byte string literal not displayed */

}

A specific metric, identified by specifying values for all of the labels of a [`MetricDescriptor`][google.api.MetricDescriptor].

func (*Metric) Descriptor

func (*Metric) Descriptor() ([]byte, []int)

Deprecated: Use Metric.ProtoReflect.Descriptor instead.

func (*Metric) GetLabels

func (x *Metric) GetLabels() map[string]string

func (*Metric) GetType

func (x *Metric) GetType() string

func (*Metric) ProtoMessage

func (*Metric) ProtoMessage()

func (*Metric) ProtoReflect

func (x *Metric) ProtoReflect() protoreflect.Message

func (*Metric) Reset

func (x *Metric) Reset()

func (*Metric) String

func (x *Metric) String() string

type MetricDescriptor

type MetricDescriptor struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`

	Type string `protobuf:"bytes,8,opt,name=type,proto3" json:"type,omitempty"`

	Labels []*label.LabelDescriptor `protobuf:"bytes,2,rep,name=labels,proto3" json:"labels,omitempty"`

	MetricKind MetricDescriptor_MetricKind "" /* 136 byte string literal not displayed */

	ValueType MetricDescriptor_ValueType "" /* 132 byte string literal not displayed */

	Unit string `protobuf:"bytes,5,opt,name=unit,proto3" json:"unit,omitempty"`

	Description string `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"`

	DisplayName string `protobuf:"bytes,7,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"`

	Metadata *MetricDescriptor_MetricDescriptorMetadata `protobuf:"bytes,10,opt,name=metadata,proto3" json:"metadata,omitempty"`

	LaunchStage api.LaunchStage `protobuf:"varint,12,opt,name=launch_stage,json=launchStage,proto3,enum=google.api.LaunchStage" json:"launch_stage,omitempty"`

	MonitoredResourceTypes []string "" /* 130 byte string literal not displayed */

}

Defines a metric type and its schema. Once a metric descriptor is created, deleting or altering it stops data collection and makes the metric type's existing data unusable.

The following are specific rules for service defined Monitoring metric descriptors:

* `type`, `metric_kind`, `value_type`, `description`, `display_name`,

`launch_stage` fields are all required. The `unit` field must be specified
if the `value_type` is any of DOUBLE, INT64, DISTRIBUTION.

* Maximum of default 500 metric descriptors per service is allowed. * Maximum of default 10 labels per metric descriptor is allowed.

The default maximum limit can be overridden. Please follow https://cloud.google.com/monitoring/quotas

func (*MetricDescriptor) Descriptor

func (*MetricDescriptor) Descriptor() ([]byte, []int)

Deprecated: Use MetricDescriptor.ProtoReflect.Descriptor instead.

func (*MetricDescriptor) GetDescription

func (x *MetricDescriptor) GetDescription() string

func (*MetricDescriptor) GetDisplayName

func (x *MetricDescriptor) GetDisplayName() string

func (*MetricDescriptor) GetLabels

func (x *MetricDescriptor) GetLabels() []*label.LabelDescriptor

func (*MetricDescriptor) GetLaunchStage

func (x *MetricDescriptor) GetLaunchStage() api.LaunchStage

func (*MetricDescriptor) GetMetadata

func (x *MetricDescriptor) GetMetadata() *MetricDescriptor_MetricDescriptorMetadata

func (*MetricDescriptor) GetMetricKind

func (x *MetricDescriptor) GetMetricKind() MetricDescriptor_MetricKind

func (*MetricDescriptor) GetMonitoredResourceTypes

func (x *MetricDescriptor) GetMonitoredResourceTypes() []string

func (*MetricDescriptor) GetName

func (x *MetricDescriptor) GetName() string

func (*MetricDescriptor) GetType

func (x *MetricDescriptor) GetType() string

func (*MetricDescriptor) GetUnit

func (x *MetricDescriptor) GetUnit() string

func (*MetricDescriptor) GetValueType

func (x *MetricDescriptor) GetValueType() MetricDescriptor_ValueType

func (*MetricDescriptor) ProtoMessage

func (*MetricDescriptor) ProtoMessage()

func (*MetricDescriptor) ProtoReflect

func (x *MetricDescriptor) ProtoReflect() protoreflect.Message

func (*MetricDescriptor) Reset

func (x *MetricDescriptor) Reset()

func (*MetricDescriptor) String

func (x *MetricDescriptor) String() string

type MetricDescriptor_MetricDescriptorMetadata

type MetricDescriptor_MetricDescriptorMetadata struct {

	// Deprecated. Must use the [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage] instead.
	//
	// Deprecated: Do not use.
	LaunchStage api.LaunchStage `protobuf:"varint,1,opt,name=launch_stage,json=launchStage,proto3,enum=google.api.LaunchStage" json:"launch_stage,omitempty"`
	// The sampling period of metric data points. For metrics which are written
	// periodically, consecutive data points are stored at this time interval,
	// excluding data loss due to errors. Metrics with a higher granularity have
	// a smaller sampling period.
	SamplePeriod *durationpb.Duration `protobuf:"bytes,2,opt,name=sample_period,json=samplePeriod,proto3" json:"sample_period,omitempty"`
	// The delay of data points caused by ingestion. Data points older than this
	// age are guaranteed to be ingested and available to be read, excluding
	// data loss due to errors.
	IngestDelay *durationpb.Duration `protobuf:"bytes,3,opt,name=ingest_delay,json=ingestDelay,proto3" json:"ingest_delay,omitempty"`
	// contains filtered or unexported fields
}

Additional annotations that can be used to guide the usage of a metric.

func (*MetricDescriptor_MetricDescriptorMetadata) Descriptor

func (*MetricDescriptor_MetricDescriptorMetadata) Descriptor() ([]byte, []int)

Deprecated: Use MetricDescriptor_MetricDescriptorMetadata.ProtoReflect.Descriptor instead.

func (*MetricDescriptor_MetricDescriptorMetadata) GetIngestDelay

func (x *MetricDescriptor_MetricDescriptorMetadata) GetIngestDelay() *durationpb.Duration

func (*MetricDescriptor_MetricDescriptorMetadata) GetLaunchStage

func (x *MetricDescriptor_MetricDescriptorMetadata) GetLaunchStage() api.LaunchStage

Deprecated: Do not use.

func (*MetricDescriptor_MetricDescriptorMetadata) GetSamplePeriod

func (x *MetricDescriptor_MetricDescriptorMetadata) GetSamplePeriod() *durationpb.Duration

func (*MetricDescriptor_MetricDescriptorMetadata) ProtoMessage

func (*MetricDescriptor_MetricDescriptorMetadata) ProtoMessage()

func (*MetricDescriptor_MetricDescriptorMetadata) ProtoReflect

func (x *MetricDescriptor_MetricDescriptorMetadata) ProtoReflect() protoreflect.Message

func (*MetricDescriptor_MetricDescriptorMetadata) Reset

func (x *MetricDescriptor_MetricDescriptorMetadata) Reset()

func (*MetricDescriptor_MetricDescriptorMetadata) String

func (x *MetricDescriptor_MetricDescriptorMetadata) String() string

type MetricDescriptor_MetricKind

type MetricDescriptor_MetricKind int32

The kind of measurement. It describes how the data is reported.

const (
	// Do not use this default value.
	MetricDescriptor_METRIC_KIND_UNSPECIFIED MetricDescriptor_MetricKind = 0
	// An instantaneous measurement of a value.
	MetricDescriptor_GAUGE MetricDescriptor_MetricKind = 1
	// The change in a value during a time interval.
	MetricDescriptor_DELTA MetricDescriptor_MetricKind = 2
	// A value accumulated over a time interval.  Cumulative
	// measurements in a time series should have the same start time
	// and increasing end times, until an event resets the cumulative
	// value to zero and sets a new start time for the following
	// points.
	MetricDescriptor_CUMULATIVE MetricDescriptor_MetricKind = 3
)

func (MetricDescriptor_MetricKind) Descriptor

func (MetricDescriptor_MetricKind) Descriptor() protoreflect.EnumDescriptor

func (MetricDescriptor_MetricKind) Enum

func (x MetricDescriptor_MetricKind) Enum() *MetricDescriptor_MetricKind

func (MetricDescriptor_MetricKind) EnumDescriptor

func (MetricDescriptor_MetricKind) EnumDescriptor() ([]byte, []int)

Deprecated: Use MetricDescriptor_MetricKind.Descriptor instead.

func (MetricDescriptor_MetricKind) Number

func (x MetricDescriptor_MetricKind) Number() protoreflect.EnumNumber

func (MetricDescriptor_MetricKind) String

func (x MetricDescriptor_MetricKind) String() string

func (MetricDescriptor_MetricKind) Type

func (MetricDescriptor_MetricKind) Type() protoreflect.EnumType

type MetricDescriptor_ValueType

type MetricDescriptor_ValueType int32

The value type of a metric.

const (
	// Do not use this default value.
	MetricDescriptor_VALUE_TYPE_UNSPECIFIED MetricDescriptor_ValueType = 0
	// The value is a boolean.
	// This value type can be used only if the metric kind is `GAUGE`.
	MetricDescriptor_BOOL MetricDescriptor_ValueType = 1
	// The value is a signed 64-bit integer.
	MetricDescriptor_INT64 MetricDescriptor_ValueType = 2
	// The value is a double precision floating point number.
	MetricDescriptor_DOUBLE MetricDescriptor_ValueType = 3
	// The value is a text string.
	// This value type can be used only if the metric kind is `GAUGE`.
	MetricDescriptor_STRING MetricDescriptor_ValueType = 4
	// The value is a [`Distribution`][google.api.Distribution].
	MetricDescriptor_DISTRIBUTION MetricDescriptor_ValueType = 5
	// The value is money.
	MetricDescriptor_MONEY MetricDescriptor_ValueType = 6
)

func (MetricDescriptor_ValueType) Descriptor

func (MetricDescriptor_ValueType) Descriptor() protoreflect.EnumDescriptor

func (MetricDescriptor_ValueType) Enum

func (x MetricDescriptor_ValueType) Enum() *MetricDescriptor_ValueType

func (MetricDescriptor_ValueType) EnumDescriptor

func (MetricDescriptor_ValueType) EnumDescriptor() ([]byte, []int)

Deprecated: Use MetricDescriptor_ValueType.Descriptor instead.

func (MetricDescriptor_ValueType) Number

func (x MetricDescriptor_ValueType) Number() protoreflect.EnumNumber

func (MetricDescriptor_ValueType) String

func (x MetricDescriptor_ValueType) String() string

func (MetricDescriptor_ValueType) Type

func (MetricDescriptor_ValueType) Type() protoreflect.EnumType

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier