[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eMetric\u003c/code\u003e class represents a specific metric identified by its label values, as defined in a \u003ccode\u003eMetricDescriptor\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eIt implements several interfaces, including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, providing functionalities for message handling, equality comparison, deep cloning, and buffer message management.\u003c/p\u003e\n"],["\u003cp\u003eThe class includes properties for defining the metric type and labels, as well as static properties like \u003ccode\u003eDescriptor\u003c/code\u003e and \u003ccode\u003eParser\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eKey methods include \u003ccode\u003eClone()\u003c/code\u003e for creating a deep clone, \u003ccode\u003eEquals()\u003c/code\u003e for comparison, and \u003ccode\u003eMergeFrom()\u003c/code\u003e for merging data from another \u003ccode\u003eMetric\u003c/code\u003e or a \u003ccode\u003eCodedInputStream\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version available is \u003ca href=\"/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.Metric\"\u003e2.15.0\u003c/a\u003e, and earlier versions like 2.10.0 and 2.2.0 are also accessible.\u003c/p\u003e\n"]]],[],null,["# Class Metric (2.17.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.17.0 (latest)](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.Metric)\n- [2.15.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.15.0/Google.Api.Metric)\n- [2.10.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.10.0/Google.Api.Metric)\n- [2.2.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.2.0/Google.Api.Metric) \n\n public sealed class Metric : IMessage\u003cMetric\u003e, IEquatable\u003cMetric\u003e, IDeepCloneable\u003cMetric\u003e, IBufferMessage, IMessage\n\nA specific metric, identified by specifying values for all of the\nlabels of a \\[`MetricDescriptor`\\]\\[google.api.MetricDescriptor\\]. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e Metric \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[Metric](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.Metric), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[Metric](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.Metric), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[Metric](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.Metric), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals)\n\nNamespace\n---------\n\n[Google.Api](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api)\n\nAssembly\n--------\n\nGoogle.Api.CommonProtos.dll\n\nConstructors\n------------\n\n### Metric()\n\n public Metric()\n\n### Metric(Metric)\n\n public Metric(Metric other)\n\nFields\n------\n\n### LabelsFieldNumber\n\n public const int LabelsFieldNumber = 2\n\nField number for the \"labels\" field.\n\n### TypeFieldNumber\n\n public const int TypeFieldNumber = 3\n\nField number for the \"type\" field.\n\nProperties\n----------\n\n### Descriptor\n\n public static MessageDescriptor Descriptor { get; }\n\n### Labels\n\n public MapField\u003cstring, string\u003e Labels { get; }\n\nThe set of label values that uniquely identify this metric. All\nlabels listed in the `MetricDescriptor` must be assigned values.\n\n### Parser\n\n public static MessageParser\u003cMetric\u003e Parser { get; }\n\n### Type\n\n public string Type { get; set; }\n\nAn existing metric type, see\n\\[google.api.MetricDescriptor\\]\\[google.api.MetricDescriptor\\]. For example,\n`custom.googleapis.com/invoice/paid/amount`.\n\nMethods\n-------\n\n### CalculateSize()\n\n public int CalculateSize()\n\n### Clone()\n\n public Metric Clone()\n\n### Equals(Metric)\n\n public bool Equals(Metric other)\n\n### Equals(object)\n\n public override bool Equals(object other)\n\n**Overrides** \n[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object))\n\n### GetHashCode()\n\n public override int GetHashCode()\n\n**Overrides** \n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode)\n\n### MergeFrom(Metric)\n\n public void MergeFrom(Metric other)\n\n### MergeFrom(CodedInputStream)\n\n public void MergeFrom(CodedInputStream input)\n\n### ToString()\n\n public override string ToString()\n\n**Overrides** \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\n### WriteTo(CodedOutputStream)\n\n public void WriteTo(CodedOutputStream output)"]]