NeuronCore mapping bug fix - #341
Merged
sky333999 merged 17 commits intoAug 14, 2025
Merged
Conversation
Latest neuron fix
sky333999
reviewed
Jul 30, 2025
| } | ||
|
|
||
| // method to add neuroncore_per_device_count attribute to all metrics | ||
| func (ed *EmptyMetricDecorator) addNeuronCorePerDeviceAttribute(metrics pmetric.MetricSlice, neuronCoresPerDevice int) { |
There was a problem hiding this comment.
Why does this have to be a datapoint attribute? Cant it be a resource attr?
Author
There was a problem hiding this comment.
We chose to do it like this because we don't have access to the resource later on. But this would be a good idea for future refactoring.
https://github.com/aws/amazon-cloudwatch-agent/blob/main/plugins/processors/gpuattributes/internal/awsneuron_metric_modifier.go#L152
There was a problem hiding this comment.
Its the same pmetric getting passed to the processor right? I dont get why it wont be available later on.
Please track this as a to-do.
Author
There was a problem hiding this comment.
Will do, thank you for pointing this out
sky333999
reviewed
Aug 14, 2025
sky333999
previously approved these changes
Aug 14, 2025
sky333999
approved these changes
Aug 14, 2025
movence
approved these changes
Aug 14, 2025
| neuronHardwareInfo, neuronHardwareInfoFound := findNeuronHardwareInfo(metrics) | ||
| if neuronHardwareInfoFound { | ||
| ed.addEmptyMetrics(neuronHardwareInfo, metrics) | ||
| neuronCoresPerDevice, foundCoresPerDevice := getNeuronCoresPerDevice(neuronHardwareInfo) |
There was a problem hiding this comment.
nit for better readability
Suggested change
| neuronCoresPerDevice, foundCoresPerDevice := getNeuronCoresPerDevice(neuronHardwareInfo) | |
| neuronCoresPerDevice, foundCoresPerDevice := getNeuronCoresPerDevice(neuronHardwareInfo) | |
| if !foundCoresPerDevice { | |
| neuronCoresPerDevice = DefaultNeuronCorePerDevice | |
| } | |
| ed.addNeuronCorePerDeviceAttribute(metrics, neuronCoresPerDevice) |
sky333999
merged commit Aug 14, 2025
726f1bd
into
amazon-contributing:aws-cwa-dev
134 of 141 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Related PR