# ExternalMetricSourceV2

- 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/ExternalMetricSourceV2.cs)

Represents an external metric source in Kubernetes for configuring autoscaling behavior based on metrics from external components or monitoring systems.

## Definition

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

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

## Remarks

This class defines the external metric to be monitored and the specific target value associated with it. The `metric` property identifies the external metric by name and optional label selectors. The `target` property provides the desired value, average value, or utilization percentage for the metric, as part of the autoscaling configuration.

## Constructors

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

## Properties

- [Metric](/reference/api/csharp/aspire.hosting.kubernetes/externalmetricsourcev2/properties.md#metric) : [MetricIdentifierV2](/reference/api/csharp/aspire.hosting.kubernetes/metricidentifierv2.md) `get; set` -- Represents the metric property utilized in the ExternalMetricSourceV2 class. This property is of type MetricIdentifierV2 and is used to identify and define a specific metric in the context of Kubernetes resource configurations.
- [Target](/reference/api/csharp/aspire.hosting.kubernetes/externalmetricsourcev2/properties.md#target) : [MetricTargetV2](/reference/api/csharp/aspire.hosting.kubernetes/metrictargetv2.md) `get; set` -- Defines the target configuration for a metric in a Kubernetes-based context.
