# ContainerResourceMetricSourceV2

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

Represents a metric source that is defined by a resource usage of a specific container. This is used for scaling purposes in a Kubernetes environment, relying on container-level metrics.

## Definition

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

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

## Constructors

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

## Properties

- [Container](/reference/api/csharp/aspire.hosting.kubernetes/containerresourcemetricsourcev2/properties.md#container) : `string` `get; set` -- Gets or sets the name of the container associated with the metric. It specifies the container within a pod to which the resource metric applies.
- [Name](/reference/api/csharp/aspire.hosting.kubernetes/containerresourcemetricsourcev2/properties.md#name) : `string` `get; set` -- Gets or sets the name of the resource metric.
- [Target](/reference/api/csharp/aspire.hosting.kubernetes/containerresourcemetricsourcev2/properties.md#target) : [MetricTargetV2](/reference/api/csharp/aspire.hosting.kubernetes/metrictargetv2.md) `get; set` -- Specifies the target for the metric being monitored in a container. Represents an instance of [MetricTargetV2](/reference/api/csharp/aspire.hosting.kubernetes/metrictargetv2.md) which defines the thresholds and values for the metric.
