# MetricIdentifierV2 Properties

- Package: [Aspire.Hosting.Kubernetes](/reference/api/csharp/aspire.hosting.kubernetes.md)
- Type: [MetricIdentifierV2](/reference/api/csharp/aspire.hosting.kubernetes/metricidentifierv2.md)
- Kind: `Properties`
- Members: `2`

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

## Name

- Name: `Name`
- Modifiers: `get; set`
- Returns: `string`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Kubernetes/Resources/MetricIdentifierV2.cs)

Gets or sets the name of the metric. This property specifies the identifier for the metric being measured or tracked.

```csharp
public string Name { get; set; }
```

## Remarks

The name is used to uniquely identify the metric and can be referenced in monitoring and metric collection systems.

## Selector

- Name: `Selector`
- Modifiers: `get; set`
- Returns: [LabelSelectorV1](/reference/api/csharp/aspire.hosting.kubernetes/labelselectorv1.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Kubernetes/Resources/MetricIdentifierV2.cs)

Represents a label selector used to filter Kubernetes resources. The selector enables the identification of a subset of objects based on their labels.

```csharp
public LabelSelectorV1 Selector { get; set; }
```

## Remarks

The selector operates based on two components: - MatchLabels: A dictionary of label key-value pairs for exact match filtering. - MatchExpressions: A set of conditions enabling complex filtering logic. This property allows dynamic selection of targeted resources through labels.
