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

feat: extend kube_inventory plugin to include resourcequota measurement and extend node and pod measurement #9627

Closed
wants to merge 12 commits into from

Conversation

varunjain0606
Copy link
Contributor

@varunjain0606 varunjain0606 commented Aug 14, 2021

Checks:

  • Updated associated README.md.
  • Wrote appropriate unit tests.
  • Pull request title or commits are in [conventional commit format]

Requirements:
Requirements have been included in the link below
#9621

Resolves
Included some more metrics in kubernetes_node, kubernetes_pod_container measurement in kube_inventory plugin as that would enhance the monitoring of k8s. Also add a resource type "resourcequotas" for even better monitoring of quota management.

Description:
Added these new metrics in kubernetes_node measurement within kube_inventory plugin.

  1. count
  2. status_condition
  3. spec_schedulable

Added tags:

  1. status
  2. condition

Added these new metrics in kubernetes_pod_container measurement within kube_inventory plugin.

  1. status_condition

Added tags:

  1. status
  2. condition

Added new kubernetes_resourcequota measurement and added these metrics

  1. hard_cpu_cores_limit
  2. hard_memory_bytes_limit
  3. hard_pods_limit
  4. used_cpu_cores
  5. used_memory_bytes
  6. used_pods

Added tags:

  1. resource
  2. namespace

Example:
Output -
kubernetes_node,host=vjain count=8i 1628918652000000000
kubernetes_node,condition=Ready,host=vjain,node_name=ip-172-17-0-2.internal,status=True status_condition=1i 1629177980000000000
kubernetes_node,cluster_namespace=tools,condition=Ready,host=vjain,node_name=ip-172-17-0-2.internal,status=True allocatable_cpu_cores=4i,allocatable_memory_bytes=7186567168i,allocatable_millicpu_cores=4000i,allocatable_pods=110i,capacity_cpu_cores=4i,capacity_memory_bytes=7291424768i,capacity_millicpu_cores=4000i,capacity_pods=110i,spec_unschedulable=0i,status_condition=1i 1628918652000000000
kubernetes_pod_container,condition=Ready,host=vjain,pod_name=uefi-5997f76f69-xzljt,status=True status_condition=1i 1629177981000000000
kubernetes_resourcequota,host=vjain,namespace=default,resource=pods-medium hard_cpu_cores=10i,hard_memory_bytes=21474836480i,hard_pods=10i,used_cpu_cores=0i,used_memory_bytes=0i,used_pods=0i 1629110393000000000

@telegraf-tiger telegraf-tiger bot added the feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin label Aug 14, 2021
@varunjain0606 varunjain0606 changed the title feat: extend kube_inventory plugin to include count, status and unschedulable node metrics feat: extend kube_inventory plugin to include resourcequota measurement and extend node and pod measurement Aug 17, 2021
@sspaink
Copy link
Contributor

sspaink commented Apr 4, 2022

@varunjain0606 thank you for contributing this pull request, it looks like there are some issues with the tests. Do you have time to continue working on this?

@sspaink sspaink added the waiting for response waiting for response from contributor label Apr 5, 2022
vjain added 2 commits April 5, 2022 16:12
…nt and extend node and pod measurement - lint fix
@varunjain0606
Copy link
Contributor Author

varunjain0606 commented Apr 5, 2022

@sspaink I have fixed the test cases. This PR has few changes that can be split into 2 or 3 PRs. Please let me know if you want me to split them. I have requirement for all of these changes along with some other changes that I can submit in the follow up PRs. These changes can be really helpful to monitor k8s infrastructure for everyone. Thanks

@telegraf-tiger telegraf-tiger bot removed the waiting for response waiting for response from contributor label Apr 5, 2022
@sspaink
Copy link
Contributor

sspaink commented Apr 19, 2022

@varunjain0606 it looks like there are two files processor and test that might have been added by mistake to this pull request, they seem like they are binaries? I think the changes you've made should be ok within just this pull request.

…nt and extend node and pod measurement - removing unncessary bin files
@varunjain0606
Copy link
Contributor Author

@varunjain0606 it looks like there are two files processor and test that might have been added by mistake to this pull request, they seem like they are binaries? I think the changes you've made should be ok within just this pull request.

Sorry for the unnecessary files in the PR. I have removed them now. Please have a look at the PR again @sspaink

@bougou
Copy link

bougou commented Apr 29, 2022

Kuberenetes node currently exposed several node conditions:

  • Ready
  • DiskPressure
  • MemoryPressure
  • NetworkUnavailable
  • PIDPressure

The condition status value might be string value False, True, or Unkown.

The #10147 PR just adds those conditions as new fields on kubernetes_node measurement with value converted to integer (0, 1, 2), with no tags are introduced.

kubernetes_node,tagname="foobar" condition_ready=0i condition_disk_pressure=1i condition_network_unavailable=1i condition_pid_pressure=1i condition_memory_pressure=1i 1547597616000000000

It seems that this PR (#9627) treats this part in way that:

Add a status_condition field with converted integer value, and adds the condition name in tag condition.

@telegraf-tiger
Copy link
Contributor

telegraf-tiger bot commented Aug 9, 2022

Download PR build artifacts for linux_amd64.tar.gz, darwin_amd64.tar.gz, and windows_amd64.zip.
Downloads for additional architectures and packages are available below.

🥳 This pull request decreases the Telegraf binary size by -3.75 % for linux amd64 (new size: 142.9 MB, nightly size 148.5 MB)

📦 Click here to get additional PR build artifacts

Artifact URLs

DEB RPM TAR GZ ZIP
amd64.deb aarch64.rpm darwin_amd64.tar.gz windows_amd64.zip
arm64.deb armel.rpm darwin_arm64.tar.gz windows_i386.zip
armel.deb armv6hl.rpm freebsd_amd64.tar.gz
armhf.deb i386.rpm freebsd_armv7.tar.gz
i386.deb ppc64le.rpm freebsd_i386.tar.gz
mips.deb riscv64.rpm linux_amd64.tar.gz
mipsel.deb s390x.rpm linux_arm64.tar.gz
ppc64el.deb x86_64.rpm linux_armel.tar.gz
riscv64.deb linux_armhf.tar.gz
s390x.deb linux_i386.tar.gz
linux_mips.tar.gz
linux_mipsel.tar.gz
linux_ppc64le.tar.gz
linux_riscv64.tar.gz
linux_s390x.tar.gz
static_linux_amd64.tar.gz

@powersj powersj added waiting for response waiting for response from contributor and removed waiting for response waiting for response from contributor labels Oct 17, 2022
@powersj powersj assigned powersj and unassigned powersj Nov 17, 2022
@powersj
Copy link
Contributor

powersj commented Feb 15, 2023

Hi @varunjain0606,

Sorry that no one ever got back to you on this PR. Are you still interested in seeing it land? If so, could I have you rebase on master and ensure tests pass?

Thanks!

@powersj powersj added the waiting for response waiting for response from contributor label Feb 15, 2023
@telegraf-tiger
Copy link
Contributor

telegraf-tiger bot commented Mar 2, 2023

Hello! I am closing this issue due to inactivity. I hope you were able to resolve your problem, if not please try posting this question in our Community Slack or Community Page. Thank you!

@telegraf-tiger telegraf-tiger bot closed this Mar 2, 2023
@varunjain0606
Copy link
Contributor Author

@powersj Can you please take a look at this updated PR. I have re-based and verified all tests are passing
#13040

@telegraf-tiger telegraf-tiger bot removed the waiting for response waiting for response from contributor label Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants