# MetricIdentifierV2

- Kind: `class`
- Package: [Aspire.Hosting.Kubernetes](/reference/api/csharp/aspire.hosting.kubernetes.md)
- Version: `13.3.0-preview.1.26254.5`
- Namespace: `Aspire.Hosting.Kubernetes.Resources`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Kubernetes/Resources/MetricIdentifierV2.cs)

Represents a metric identifier in a Kubernetes context, primarily used to identify and specify a metric related to various Kubernetes resources or objects.

## Definition

```csharp
namespace Aspire.Hosting.Kubernetes.Resources;

public sealed class MetricIdentifierV2
{
    // ...
}
```

## Remarks

A metric identifier typically consists of a name that denotes the metric and an optional selector, which is used to specify additional filtering criteria for selecting specific metric instances. This class is designed to be serialized and deserialized in YAML format and is often used in conjunction with other Kubernetes resource configurations.

## Constructors

- [MetricIdentifierV2](/reference/api/csharp/aspire.hosting.kubernetes/metricidentifierv2/constructors.md#constructor)

## Properties

- [Name](/reference/api/csharp/aspire.hosting.kubernetes/metricidentifierv2/properties.md#name) : `string` `get; set` -- Gets or sets the name of the metric. This property specifies the identifier for the metric being measured or tracked.
- [Selector](/reference/api/csharp/aspire.hosting.kubernetes/metricidentifierv2/properties.md#selector) : [LabelSelectorV1](/reference/api/csharp/aspire.hosting.kubernetes/labelselectorv1.md) `get; set` -- Represents a label selector used to filter Kubernetes resources. The selector enables the identification of a subset of objects based on their labels.
