Show / Hide Table of Contents

Class 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.

Inheritance
System.Object
MetricDescriptor
Implements
IMessage<MetricDescriptor>
IMessage
System.IEquatable<MetricDescriptor>
IDeepCloneable<MetricDescriptor>
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Google.Api
Assembly: Google.Api.CommonProtos.dll
Syntax
public sealed class MetricDescriptor : IMessage<MetricDescriptor>, IMessage, IEquatable<MetricDescriptor>, IDeepCloneable<MetricDescriptor>

Constructors

MetricDescriptor()

Declaration
public MetricDescriptor()

MetricDescriptor(MetricDescriptor)

Declaration
public MetricDescriptor(MetricDescriptor other)
Parameters
Type Name Description
MetricDescriptor other

Fields

DescriptionFieldNumber

Field number for the "description" field.

Declaration
public const int DescriptionFieldNumber = 6
Field Value
Type Description
System.Int32

DisplayNameFieldNumber

Field number for the "display_name" field.

Declaration
public const int DisplayNameFieldNumber = 7
Field Value
Type Description
System.Int32

LabelsFieldNumber

Field number for the "labels" field.

Declaration
public const int LabelsFieldNumber = 2
Field Value
Type Description
System.Int32

LaunchStageFieldNumber

Field number for the "launch_stage" field.

Declaration
public const int LaunchStageFieldNumber = 12
Field Value
Type Description
System.Int32

MetadataFieldNumber

Field number for the "metadata" field.

Declaration
public const int MetadataFieldNumber = 10
Field Value
Type Description
System.Int32

MetricKindFieldNumber

Field number for the "metric_kind" field.

Declaration
public const int MetricKindFieldNumber = 3
Field Value
Type Description
System.Int32

NameFieldNumber

Field number for the "name" field.

Declaration
public const int NameFieldNumber = 1
Field Value
Type Description
System.Int32

TypeFieldNumber

Field number for the "type" field.

Declaration
public const int TypeFieldNumber = 8
Field Value
Type Description
System.Int32

UnitFieldNumber

Field number for the "unit" field.

Declaration
public const int UnitFieldNumber = 5
Field Value
Type Description
System.Int32

ValueTypeFieldNumber

Field number for the "value_type" field.

Declaration
public const int ValueTypeFieldNumber = 4
Field Value
Type Description
System.Int32

Properties

Description

A detailed description of the metric, which can be used in documentation.

Declaration
public string Description { get; set; }
Property Value
Type Description
System.String

Descriptor

Declaration
public static MessageDescriptor Descriptor { get; }
Property Value
Type Description
MessageDescriptor

DisplayName

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.

Declaration
public string DisplayName { get; set; }
Property Value
Type Description
System.String

Labels

The set of labels that can be used to describe a specific instance of this metric type. For example, the appengine.googleapis.com/http/server/response_latencies metric type has a label for the HTTP response code, response_code, so you can look at latencies for successful responses or just for responses that failed.

Declaration
public RepeatedField<LabelDescriptor> Labels { get; }
Property Value
Type Description
RepeatedField<LabelDescriptor>

LaunchStage

Optional. The launch stage of the metric definition.

Declaration
public LaunchStage LaunchStage { get; set; }
Property Value
Type Description
LaunchStage

Metadata

Optional. Metadata which can be used to guide usage of the metric.

Declaration
public MetricDescriptor.Types.MetricDescriptorMetadata Metadata { get; set; }
Property Value
Type Description
MetricDescriptor.Types.MetricDescriptorMetadata

MetricKind

Whether the metric records instantaneous values, changes to a value, etc. Some combinations of metric_kind and value_type might not be supported.

Declaration
public MetricDescriptor.Types.MetricKind MetricKind { get; set; }
Property Value
Type Description
MetricDescriptor.Types.MetricKind

Name

The resource name of the metric descriptor.

Declaration
public string Name { get; set; }
Property Value
Type Description
System.String

Parser

Declaration
public static MessageParser<MetricDescriptor> Parser { get; }
Property Value
Type Description
MessageParser<MetricDescriptor>

Type

The metric type, including its DNS name prefix. The type is not URL-encoded. All user-defined metric types have the DNS name custom.googleapis.com or external.googleapis.com. Metric types should use a natural hierarchical grouping. For example:

"custom.googleapis.com/invoice/paid/amount" "external.googleapis.com/prometheus/up" "appengine.googleapis.com/http/server/response_latencies"

Declaration
public string Type { get; set; }
Property Value
Type Description
System.String

Unit

The unit in which the metric value is reported. It is only applicable if the value_type is INT64, DOUBLE, or DISTRIBUTION. The supported units are a subset of The Unified Code for Units of Measure standard:

Basic units (UNIT)

  • bit bit
  • By byte
  • s second
  • min minute
  • h hour
  • d day

Prefixes (PREFIX)

  • k kilo (10**3)
  • M mega (10**6)
  • G giga (10**9)
  • T tera (10**12)
  • P peta (10**15)
  • E exa (10**18)
  • Z zetta (10**21)
  • Y yotta (10**24)
  • m milli (10**-3)
  • u micro (10**-6)
  • n nano (10**-9)
  • p pico (10**-12)
  • f femto (10**-15)
  • a atto (10**-18)
  • z zepto (10**-21)
  • y yocto (10**-24)
  • Ki kibi (2**10)
  • Mi mebi (2**20)
  • Gi gibi (2**30)
  • Ti tebi (2**40)

Grammar

The grammar also includes these connectors:

  • / division (as an infix operator, e.g. 1/s).
  • . multiplication (as an infix operator, e.g. GBy.d)

The grammar for a unit is as follows:

Expression = Component { "." Component } { "/" Component } ;

Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] | Annotation | "1" ;

Annotation = "{" NAME "}" ;

Notes:

  • Annotation is just a comment if it follows a UNIT and is equivalent to 1 if it is used alone. For examples, {requests}/s == 1/s, By{transmitted}/s == By/s.
  • NAME is a sequence of non-blank printable ASCII characters not containing '{' or '}'.
  • 1 represents dimensionless value 1, such as in 1/s.
  • % represents dimensionless value 1/100, and annotates values giving a percentage.
Declaration
public string Unit { get; set; }
Property Value
Type Description
System.String

ValueType

Whether the measurement is an integer, a floating-point number, etc. Some combinations of metric_kind and value_type might not be supported.

Declaration
public MetricDescriptor.Types.ValueType ValueType { get; set; }
Property Value
Type Description
MetricDescriptor.Types.ValueType

Methods

CalculateSize()

Declaration
public int CalculateSize()
Returns
Type Description
System.Int32
Implements
IMessage.CalculateSize()

Clone()

Declaration
public MetricDescriptor Clone()
Returns
Type Description
MetricDescriptor
Implements
IDeepCloneable<T>.Clone()

Equals(MetricDescriptor)

Declaration
public bool Equals(MetricDescriptor other)
Parameters
Type Name Description
MetricDescriptor other
Returns
Type Description
System.Boolean
Implements
System.IEquatable<T>.Equals(T)

Equals(Object)

Declaration
public override bool Equals(object other)
Parameters
Type Name Description
System.Object other
Returns
Type Description
System.Boolean
Overrides
System.Object.Equals(System.Object)

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32
Overrides
System.Object.GetHashCode()

MergeFrom(MetricDescriptor)

Declaration
public void MergeFrom(MetricDescriptor other)
Parameters
Type Name Description
MetricDescriptor other
Implements
IMessage<T>.MergeFrom(T)

MergeFrom(CodedInputStream)

Declaration
public void MergeFrom(CodedInputStream input)
Parameters
Type Name Description
CodedInputStream input
Implements
IMessage.MergeFrom(CodedInputStream)

ToString()

Declaration
public override string ToString()
Returns
Type Description
System.String
Overrides
System.Object.ToString()

WriteTo(CodedOutputStream)

Declaration
public void WriteTo(CodedOutputStream output)
Parameters
Type Name Description
CodedOutputStream output
Implements
IMessage.WriteTo(CodedOutputStream)

Explicit Interface Implementations

IMessage.Descriptor

Declaration
MessageDescriptor IMessage.Descriptor { get; }
Returns
Type Description
MessageDescriptor
Implements
IMessage.Descriptor
Back to top