Skip to content
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

use localNode decorator for DCGM and Neuron metrics for host metadata #244

Merged
merged 2 commits into from
Oct 24, 2024

Conversation

movence
Copy link

@movence movence commented Oct 24, 2024

Description:
For some edge cases, DCGM or Neuron metrics for ContainerInsights are missing host metadata labels including InstanceId and/or InstanceType. This PR is to use localNode decorator instead k8sDecorator to inject those host metadata while processing metrics.

Testing:
Tested on a test cluster to verify those metadata are still coming as part of DCGM/Neuron EMF logs (some sections have been redacted)

{
    "CloudWatchMetrics": [
        {
            "Namespace": "ContainerInsights",
            "Dimensions": [
                [
                    "ClusterName"
                ],
                [
                    "ClusterName",
                    "Namespace"
                ],
                [
                    "ClusterName",
                    "Namespace",
                    "PodName"
                ],
                [
                    "ClusterName",
                    "FullPodName",
                    "Namespace",
                    "PodName"
                ],
                [
                    "ClusterName",
                    "FullPodName",
                    "GpuDevice",
                    "Namespace",
                    "PodName"
                ]
            ],
            "Metrics": [
                {
                    "Name": "pod_gpu_power_draw",
                    "Unit": "None"
                },
                {
                    "Name": "pod_gpu_utilization",
                    "Unit": "Percent"
                },
                {
                    "Name": "pod_gpu_memory_utilization",
                    "Unit": "Percent"
                },
                {
                    "Name": "pod_gpu_memory_used",
                    "Unit": "Bytes"
                },
                {
                    "Name": "pod_gpu_memory_total",
                    "Unit": "Bytes"
                },
                {
                    "Name": "pod_gpu_temperature",
                    "Unit": "None"
                }
            ]
        }
    ],
    "ClusterName": "mixed-cluster",
    "FullPodName": "gpu-burn-6dcbd994fb-r6mxr",
    "GpuDevice": "nvidia0",
    "InstanceId": "i-0cc88415ec370ecf1",
    "InstanceType": "g4dn.12xlarge",
    "Namespace": "amazon-cloudwatch",
    "NodeName": "node",
    "PodName": "gpu-burn",
    "Sources": [
        "dcgm",
        "pod",
        "calculated"
    ],
    "Timestamp": "1729777653591",
    "Type": "PodGPU",
    "UUID": "uuid",
    "Version": "0",
    "kubernetes": {
        ...
    },
    "pod_gpu_memory_total": 16106127360,
    "pod_gpu_memory_used": 14272167936,
    "pod_gpu_memory_utilization": 90.1268,
    "pod_gpu_power_draw": 69.415,
    "pod_gpu_temperature": 34,
    "pod_gpu_utilization": 100
}

Documentation:

jefchien
jefchien previously approved these changes Oct 24, 2024
@@ -96,7 +89,7 @@ func GetNeuronMetricRelabelConfigs(hostinfo prometheusscraper.HostInfoProvider)
Action: relabel.Replace,
},
// hacky way to inject static values (clusterName) to label set without additional processor
// relabel looks up an existing label then creates another label with given key (TargetLabel) and value (static)
// could be removed since these labels are now set by localNode decorator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just remove them? They get overwritten in the localnode decorator like you said, so there isn't much use to them.

@movence movence merged commit 0c70760 into amazon-contributing:aws-cwa-dev Oct 24, 2024
142 of 146 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants