- Resource: MetricDescriptor
- MetricKind
- ValueType
- MetricDescriptorMetadata
- TimeSeriesResourceHierarchyLevel
- Methods
Resource: MetricDescriptor
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.
JSON representation |
---|
{ "name": string, "type": string, "labels": [ { object ( |
Fields | |
---|---|
name |
The resource name of the metric descriptor. |
type |
The metric type, including its DNS name prefix. The type is not URL-encoded. All user-defined metric types have the DNS name
|
labels[] |
The set of labels that can be used to describe a specific instance of this metric type. For example, the |
metric |
Whether the metric records instantaneous values, changes to a value, etc. Some combinations of |
value |
Whether the measurement is an integer, a floating-point number, etc. Some combinations of |
unit |
The units in which the metric value is reported. It is only applicable if the Different systems might scale the values to be more easily displayed (so a value of If you want a custom metric to record the exact number of CPU-seconds used by a job, you can create an Alternatively, if you want a custom metric to record data in a more granular way, you can create a The supported units are a subset of The Unified Code for Units of Measure standard: Basic units (UNIT)
Prefixes (PREFIX)
Grammar The grammar also includes these connectors:
The grammar for a unit is as follows:
Notes:
|
description |
A detailed description of the metric, which can be used in documentation. |
display |
A concise name for the metric, which can be displayed in user interfaces. Use sentence case without an ending period, for example "Request count". This field is optional but it is recommended to be set for any metrics associated with user-visible concepts, such as Quota. |
metadata |
Optional. Metadata which can be used to guide usage of the metric. |
launch |
Optional. The launch stage of the metric definition. |
monitored |
Read-only. If present, then a |
MetricKind
The kind of measurement. It describes how the data is reported. For information on setting the start time and end time based on the MetricKind, see TimeInterval
.
Enums | |
---|---|
METRIC_KIND_UNSPECIFIED |
Do not use this default value. |
GAUGE |
An instantaneous measurement of a value. |
DELTA |
The change in a value during a time interval. |
CUMULATIVE |
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. |
ValueType
The value type of a metric.
Enums | |
---|---|
VALUE_TYPE_UNSPECIFIED |
Do not use this default value. |
BOOL |
The value is a boolean. This value type can be used only if the metric kind is GAUGE . |
INT64 |
The value is a signed 64-bit integer. |
DOUBLE |
The value is a double precision floating point number. |
STRING |
The value is a text string. This value type can be used only if the metric kind is GAUGE . |
DISTRIBUTION |
The value is a . |
MetricDescriptorMetadata
Additional annotations that can be used to guide the usage of a metric.
JSON representation |
---|
{ "launchStage": enum ( |
Fields | |
---|---|
launchStage |
Deprecated. Must use the |
sample |
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. |
ingest |
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. |
time |
The scope of the timeseries data of the metric. |
TimeSeriesResourceHierarchyLevel
The resource hierarchy level of the timeseries data of a metric.
Enums | |
---|---|
TIME_SERIES_RESOURCE_HIERARCHY_LEVEL_UNSPECIFIED |
Do not use this default value. |
PROJECT |
Scopes a metric to a project. |
ORGANIZATION |
Scopes a metric to an organization. |
FOLDER |
Scopes a metric to a folder. |
Methods |
|
---|---|
|
Creates a new metric descriptor. |
|
Deletes a metric descriptor. |
|
Gets a single metric descriptor. |
|
Lists metric descriptors that match a filter. |