-
Notifications
You must be signed in to change notification settings - Fork 849
Move Microsoft.Extensions.Diagnostics.ResourceMonitoring.Kubernetes to stable #7253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Move Microsoft.Extensions.Diagnostics.ResourceMonitoring.Kubernetes to stable #7253
Conversation
|
@evgenyfedorov2 We probably should drop reading requests in Linux due to change in formula for weights from #7239. internal sealed class KubernetesResourceQuotaProvider : ResourceQuotaProvider
{
public override ResourceQuota GetResourceQuota()
{
ResourceQuota quota = new()
{
BaselineCpuInCores = ConvertMillicoreToCpuUnit(_kubernetesMetadata.RequestsCpu),
MaxCpuInCores = ConvertMillicoreToCpuUnit(_kubernetesMetadata.LimitsCpu),
BaselineMemoryInBytes = _kubernetesMetadata.RequestsMemory,
MaxMemoryInBytes = _kubernetesMetadata.LimitsMemory,
};
// On Linux, CPU requests are determined with weights, where eg. 1 CPUs' weight is equal to 1.02539062
// If we decide to read from K8s metadata it will have different results.
if (OperatingSystem.IsLinux())
{
if (_useLinuxCalculationV2)
{
quota.BaselineCpuInCores = _parser.GetCgroupRequestCpuV2();
}
else
{
quota.BaselineCpuInCores = _parser.GetCgroupRequestCpu();
}
}
if (quota.BaselineCpuInCores <= 0.0)
{
quota.BaselineCpuInCores = quota.MaxCpuInCores;
}
if (quota.BaselineMemoryInBytes == 0)
{
quota.BaselineMemoryInBytes = quota.MaxMemoryInBytes;
}
return quota;
}
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR transitions the Microsoft.Extensions.Diagnostics.ResourceMonitoring.Kubernetes library from experimental/dev stage to stable by removing experimental attributes and increasing quality thresholds. However, there is a critical issue with an invalid Stage value that must be corrected.
Changes:
- Removes experimental attribute injection and dev stage diagnostic ID (EXTEXP0016)
- Changes Stage from "dev" to "stable" (invalid - should be "normal")
- Increases MinMutationScore requirement from 90 to 95
...eMonitoring.Kubernetes/Microsoft.Extensions.Diagnostics.ResourceMonitoring.Kubernetes.csproj
Outdated
Show resolved
Hide resolved
…ing.Kubernetes/Microsoft.Extensions.Diagnostics.ResourceMonitoring.Kubernetes.csproj Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we really need this file? I don't remember having to generate it here https://github.com/dotnet/extensions/pull/7161/changes, for instance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm getting failures in the build because of lack of the experimental flag for new API. I though it will disable it but it didn't, the <EnablePackageValidation>false</EnablePackageValidation> is not fixing that either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you try a json file similar to this https://github.com/evgenyfedorov2/dotnet-extensions/blob/91cce8dd711dcad476be62009b146c60415d722c/src/Libraries/Microsoft.Extensions.AmbientMetadata.Build/Microsoft.Extensions.AmbientMetadata.Build.json - you can generate it with https://github.com/evgenyfedorov2/dotnet-extensions/tree/main/eng/Tools/ApiChief
Microsoft Reviewers: Open in CodeFlow