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

Add kubelet summary API for Windows #142

Conversation

KlwntSingh
Copy link

Description:
This PR adds support for running awscontainerinsightsreceiver on Windows.
Layed out code structure for kubelet summary API for Windows.
Also changed existing logic which is not compatible with Windows and made it compatible.

Testing:

  1. Build CW agent binaries using these changes locally for all 3 platforms i.e. Linux, Windows.
  2. Testing CW agent inside Windows container image, It runs and some metrics from kubelet summary API are getting collected.

This PR defines code structure for metric provider which works on Windows.

### Changelog
1. Changed receiver.go in awscontainerinsights to run for Windows with metric provider.
2. Added summary API in kubeletclient
3. Add kubeletProvider to return metrics at different levels i.e. pod, contianer, node.
4. Updated hostInfo providers to run for Windows.
5. Updated ebsVolume Info provider to run for Windows.

## Todos:
1. Define correct ebsVolume Info provider for Windows
2. Change logic around k8s leader election to run for Windows
@KlwntSingh KlwntSingh force-pushed the ci-windows-basic-pod-metrics-kubelet-1 branch from b7a7513 to d575b52 Compare December 16, 2023 19:00
@KlwntSingh KlwntSingh force-pushed the ci-windows-basic-pod-metrics-kubelet-1 branch from bd19de8 to 97d5c39 Compare December 17, 2023 05:02
@KlwntSingh
Copy link
Author

@chadpatel you already reviewed same PR request against fork
KlwntSingh#1

@KlwntSingh KlwntSingh requested a review from chadpatel December 18, 2023 18:40
@KlwntSingh KlwntSingh changed the base branch from windows-ci-aws-cwa-dev to aws-cwa-ciwindows December 18, 2023 21:22
Copy link

@chadpatel chadpatel left a comment

Choose a reason for hiding this comment

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

Previously reviewed here KlwntSingh#1

Copy link

@nathalapooja nathalapooja left a comment

Choose a reason for hiding this comment

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

Can we keep adding the unit tests from beginning to each metric for windows.

@KlwntSingh KlwntSingh merged commit 4edef80 into amazon-contributing:aws-cwa-ciwindows Dec 19, 2023
58 of 67 checks passed
KlwntSingh added a commit to KlwntSingh/opentelemetry-collector-contrib that referenced this pull request Jan 30, 2024
* Add pod level metric collection for Windows

This PR defines code structure for metric provider which works on Windows.

### Changelog
1. Changed receiver.go in awscontainerinsights to run for Windows with metric provider.
2. Added summary API in kubeletclient
3. Add kubeletProvider to return metrics at different levels i.e. pod, contianer, node.
4. Updated hostInfo providers to run for Windows.
5. Updated ebsVolume Info provider to run for Windows.

## Todos:
1. Define correct ebsVolume Info provider for Windows
2. Change logic around k8s leader election to run for Windows
# Conflicts:
#	receiver/awscontainerinsightreceiver/internal/stores/kubeletutil/kubeletclient.go
KlwntSingh added a commit to KlwntSingh/opentelemetry-collector-contrib that referenced this pull request Feb 2, 2024
* Add pod level metric collection for Windows

This PR defines code structure for metric provider which works on Windows.

1. Changed receiver.go in awscontainerinsights to run for Windows with metric provider.
2. Added summary API in kubeletclient
3. Add kubeletProvider to return metrics at different levels i.e. pod, contianer, node.
4. Updated hostInfo providers to run for Windows.
5. Updated ebsVolume Info provider to run for Windows.

1. Define correct ebsVolume Info provider for Windows
2. Change logic around k8s leader election to run for Windows
KlwntSingh added a commit to KlwntSingh/opentelemetry-collector-contrib that referenced this pull request Feb 2, 2024
* Add pod level metric collection for Windows

This PR defines code structure for metric provider which works on Windows.

1. Changed receiver.go in awscontainerinsights to run for Windows with metric provider.
2. Added summary API in kubeletclient
3. Add kubeletProvider to return metrics at different levels i.e. pod, contianer, node.
4. Updated hostInfo providers to run for Windows.
5. Updated ebsVolume Info provider to run for Windows.

1. Define correct ebsVolume Info provider for Windows
2. Change logic around k8s leader election to run for Windows
KlwntSingh added a commit to KlwntSingh/opentelemetry-collector-contrib that referenced this pull request Feb 22, 2024
* Add pod level metric collection for Windows

This PR defines code structure for metric provider which works on Windows.

### Changelog
1. Changed receiver.go in awscontainerinsights to run for Windows with metric provider.
2. Added summary API in kubeletclient
3. Add kubeletProvider to return metrics at different levels i.e. pod, contianer, node.
4. Updated hostInfo providers to run for Windows.
5. Updated ebsVolume Info provider to run for Windows.

## Todos:
1. Define correct ebsVolume Info provider for Windows
2. Change logic around k8s leader election to run for Windows
# Conflicts:
#	receiver/awscontainerinsightreceiver/internal/stores/kubeletutil/kubeletclient.go
KlwntSingh added a commit to KlwntSingh/opentelemetry-collector-contrib that referenced this pull request Feb 22, 2024
* Add pod level metric collection for Windows

This PR defines code structure for metric provider which works on Windows.

1. Changed receiver.go in awscontainerinsights to run for Windows with metric provider.
2. Added summary API in kubeletclient
3. Add kubeletProvider to return metrics at different levels i.e. pod, contianer, node.
4. Updated hostInfo providers to run for Windows.
5. Updated ebsVolume Info provider to run for Windows.

1. Define correct ebsVolume Info provider for Windows
2. Change logic around k8s leader election to run for Windows
KlwntSingh added a commit that referenced this pull request Feb 29, 2024
… commits (#168)

Add support for Container Insights on Windows for EKS  

* Add kubelet summary API for Windows (#142)
* CPU extractors with unit tests (#146)
* Add memory extractors for pod and node level (#147)
* Define structs for CPU and Memory stats (#149)
* Add Container level metrics for CPU and memory resources. (#150)
* Add storage metrics for container and node level (#151)
* Add network metrics (#152)
* Enable awscontainerinsights receiver to run inside Host Process container (#153)
* Add HCS shim api as alternative source for metric provider (#154)
* Add check for host process container before reading from hcshim (#156)
* Fix CPU utilization percentage for Windows nodes (#161)
* Add List of Metrics for Windows + Design (#166)
* fix fstype (#164)
KlwntSingh added a commit to KlwntSingh/opentelemetry-collector-contrib that referenced this pull request Mar 2, 2024
* Add pod level metric collection for Windows

This PR defines code structure for metric provider which works on Windows.

1. Changed receiver.go in awscontainerinsights to run for Windows with metric provider.
2. Added summary API in kubeletclient
3. Add kubeletProvider to return metrics at different levels i.e. pod, contianer, node.
4. Updated hostInfo providers to run for Windows.
5. Updated ebsVolume Info provider to run for Windows.

1. Define correct ebsVolume Info provider for Windows
2. Change logic around k8s leader election to run for Windows

# Conflicts:
#	receiver/awscontainerinsightreceiver/internal/cadvisor/extractors/cpu_extractor.go
#	receiver/awscontainerinsightreceiver/internal/cadvisor/extractors/diskio_extractor.go
#	receiver/awscontainerinsightreceiver/internal/cadvisor/extractors/extractor.go
#	receiver/awscontainerinsightreceiver/internal/cadvisor/extractors/fs_extractor.go
#	receiver/awscontainerinsightreceiver/internal/cadvisor/extractors/mem_extractor.go
#	receiver/awscontainerinsightreceiver/internal/cadvisor/extractors/net_extractor.go
#	receiver/awscontainerinsightreceiver/receiver.go
KlwntSingh added a commit that referenced this pull request Mar 7, 2024
* Add kubelet summary API for Windows (#142)
* CPU extractors with unit tests (#146)
* Add memory extractors for pod and node level (#147)
* Define structs for CPU and Memory stats (#149)
* Add Container level metrics for CPU and memory resources. (#150)
* Add storage metrics for container and node level (#151)
* Add network metrics (#152)
* Enable awscontainerinsights receiver to run inside Host Process container (#153)
* Add HCS shim api as alternative source for metric provider (#154)
* Add check for host process container before reading from hcshim (#156)
* Fix CPU utilization percentage for Windows nodes (#161)
* Add List of Metrics for Windows + Design (#166)
* fix fstype (#164)
* Add windows build tag to fix building cw agent on Windows
* Downgrade internal/aws/containerinsight from 0.92 0.89
* Separate unit tests in util.go specific for Windows
* Fix util unit tests applicable for Windows
* Fix goporto issue
* Fix lint issue
* Fix regression in unit tests caused due to rebasing mainline
* Add unit tests for k8s Windows
* Add unit test for kubelet client on Windows
* Run DCGM scrapper only for CW agent on Linux
* Separate out node Volume unit tests for Windows
* Add changelog for Container Insights on Windows
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