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

[receivers/awscontainerinsightsreceiver] Add podresourcesstore in aws… #183

Merged

Conversation

aditya-purang
Copy link

Description:

- Add a new store in awscontainerinsightreceiver, this store gets the mapping between pod/container and their allocated devices.
PS : we need to add the mount volume mount and volume for pod-resources in the agent operator package, will ask @ssamartp to add those in his PR.

NOTE : This pr is same as link but the branches have been switched to aws-cwa-dev instead of main.

Testing:

Tested the api in a test cluster with a custom script:

&PodResources{
  Name: trn1-mlp,
  Namespace: default,
  Containers: []*ContainerResources{
    &ContainerResources{
      Name: trn1-mlp,
      Devices: []*ContainerDevices{
        &ContainerDevices{ResourceName: aws.amazon.com/neuron, DeviceIds: [9], Topology: nil},
        &ContainerDevices{ResourceName: aws.amazon.com/neuron, DeviceIds: [8], Topology: nil},
        &ContainerDevices{ResourceName: aws.amazon.com/neuron, DeviceIds: [1], Topology: nil},
        &ContainerDevices{ResourceName: aws.amazon.com/neuron, DeviceIds: [4], Topology: nil},
        &ContainerDevices{ResourceName: aws.amazon.com/neuron, DeviceIds: [0], Topology: nil},
        &ContainerDevices{ResourceName: aws.amazon.com/neuron, DeviceIds: [11], Topology: nil},
        &ContainerDevices{ResourceName: aws.amazon.com/neuron, DeviceIds: [3], Topology: nil},
        &ContainerDevices{ResourceName: aws.amazon.com/neuron, DeviceIds: [7], Topology: nil},
        &ContainerDevices{ResourceName: aws.amazon.com/neuron, DeviceIds: [12], Topology: nil},
        &ContainerDevices{ResourceName: aws.amazon.com/neuron, DeviceIds: [6], Topology: nil},
        &ContainerDevices{ResourceName: aws.amazon.com/neuron, DeviceIds: [13], Topology: nil},
        &ContainerDevices{ResourceName: aws.amazon.com/neuron, DeviceIds: [2], Topology: nil},
        &ContainerDevices{ResourceName: aws.amazon.com/neuron, DeviceIds: [10], Topology: nil},
        &ContainerDevices{ResourceName: aws.amazon.com/neuron, DeviceIds: [14], Topology: nil},
        &ContainerDevices{ResourceName: aws.amazon.com/neuron, DeviceIds: [5], Topology: nil},
        &ContainerDevices{ResourceName: aws.amazon.com/neuron, DeviceIds: [15], Topology: nil},
      },
      CpuIds: [],
      Memory: []*ContainerMemory{},
      DynamicResources: []*DynamicResource{},
    },
  },
}

also tested on a the test cluster and printed the map, some of the entries in the map:

2024-03-01T17:06:36Z I! {"caller":"stores/podresourcesstore.go:146","msg":"/nContainerInfo : {default_trn1-mlp_trn1-mlp} -> ResourceInfo : {aws.amazon.com/neuron_2_}","kind":"receiver","name":"awscontainerinsightreceiver","data_type":"metrics"}
2024-03-01T17:06:36Z I! {"caller":"stores/podresourcesstore.go:146","msg":"/nContainerInfo : {default_trn1-mlp_trn1-mlp} -> ResourceInfo : {aws.amazon.com/neuron_14_}","kind":"receiver","name":"awscontainerinsightreceiver","data_type":"metrics"}
2024-03-01T17:06:36Z I! {"caller":"stores/podresourcesstore.go:146","msg":"/nContainerInfo : {default_trn1-mlp_trn1-mlp} -> ResourceInfo : {aws.amazon.com/neuron_5_}","kind":"receiver","name":"awscontainerinsightreceiver","data_type":"metrics"}
2024-03-01T17:06:36Z I! {"caller":"stores/podresourcesstore.go:146","msg":"/nContainerInfo : {default_trn1-mlp_trn1-mlp} -> ResourceInfo : {aws.amazon.com/neuron_9_}","kind":"receiver","name":"awscontainerinsightreceiver","data_type":"metrics"}
2024-03-01T17:06:36Z I! {"caller":"stores/podresourcesstore.go:146","msg":"/nContainerInfo : {default_trn1-mlp_trn1-mlp} -> ResourceInfo : {aws.amazon.com/neuron_12_}","kind":"receiver","name":"awscontainerinsightreceiver","data_type":"metrics"}
2024-03-01T17:06:46Z I! {"caller":"stores/podresourcesstore.go:146","msg":"/nContainerInfo : {default_trn1-mlp_trn1-mlp} -> ResourceInfo : {aws.amazon.com/neuron_14_}","kind":"receiver","name":"awscontainerinsightreceiver","data_type":"metrics"}
2024-03-01T17:06:46Z I! {"caller":"stores/podresourcesstore.go:146","msg":"/nContainerInfo : {default_trn1-mlp_trn1-mlp} -> ResourceInfo : {aws.amazon.com/neuron_4_}","kind":"receiver","name":"awscontainerinsightreceiver","data_type":"metrics"}
2024-03-01T17:06:46Z I! {"caller":"stores/podresourcesstore.go:146","msg":"/nContainerInfo : {default_trn1-mlp_trn1-mlp} -> ResourceInfo : {aws.amazon.com/neuron_7_}","kind":"receiver","name":"awscontainerinsightreceiver","data_type":"metrics"}
2024-03-01T17:06:46Z I! {"caller":"stores/podresourcesstore.go:146","msg":"/nContainerInfo : {default_trn1-mlp_trn1-mlp} -> ResourceInfo : {aws.amazon.com/neuron_3_}","kind":"receiver","name":"awscontainerinsightreceiver","data_type":"metrics"}
2024-03-01T17:06:46Z I! {"caller":"stores/podresourcesstore.go:146","msg":"/nContainerInfo : {default_trn1-mlp_trn1-mlp} -> ResourceInfo : {aws.amazon.com/neuron_8_}","kind":"receiver","name":"awscontainerinsightreceiver","data_type":"metrics"}
2024-03-01T17:06:46Z I! {"caller":"stores/podresourcesstore.go:146","msg":"/nContainerInfo : {default_trn1-mlp_trn1-mlp} -> ResourceInfo : {aws.amazon.com/neuron_1_}","kind":"receiver","name":"awscontainerinsightreceiver","data_type":"metrics"}
2024-03-01T17:06:46Z I! {"caller":"stores/podresourcesstore.go:146","msg":"/nContainerInfo : {default_trn1-mlp_trn1-mlp} -> ResourceInfo : {aws.amazon.com/neuron_5_}","kind":"receiver","name":"awscontainerinsightreceiver","data_type":"metrics"}
2024-03-01T17:06:46Z I! {"caller":"stores/podresourcesstore.go:146","msg":"/nContainerInfo : {default_trn1-mlp_trn1-mlp} -> ResourceInfo : {aws.amazon.com/neuron_10_}","kind":"receiver","name":"awscontainerinsightreceiver","data_type":"metrics"}

straussb
straussb previously approved these changes Mar 6, 2024
@aditya-purang aditya-purang merged commit bebf689 into amazon-contributing:aws-cwa-dev Mar 6, 2024
65 of 77 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