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(inputs.kubernetes): Extend kube_inventory plugin to include resourcequota,secrets measurement and extend node and pod measurement #13040

Merged
merged 20 commits into from
May 19, 2023

Conversation

varunjain0606
Copy link
Contributor

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 Apr 5, 2023
Copy link
Contributor

@powersj powersj left a comment

Choose a reason for hiding this comment

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

Hi,

Thanks for putting this up again. I took a quick high-level look at this and have a couple questions about what each field/tags, plus some in-line questions:

spec_schedulable

Should this be spec_unschedulable? I do not see spec_schedulable called out in the examples, readme, or code.

plugins/inputs/kubernetes/kubernetes.go Show resolved Hide resolved
plugins/inputs/kube_inventory/node.go Show resolved Hide resolved
plugins/inputs/kube_inventory/pod.go Outdated Show resolved Hide resolved
plugins/inputs/kube_inventory/kube_inventory.go Outdated Show resolved Hide resolved
plugins/inputs/kube_inventory/certificate.go Show resolved Hide resolved
plugins/inputs/kube_inventory/node.go Outdated Show resolved Hide resolved
@powersj powersj self-assigned this Apr 5, 2023
@varunjain0606
Copy link
Contributor Author

@powersj I have submitted the changes. Please have a look.

@powersj powersj added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Apr 12, 2023
@powersj powersj assigned srebhan and unassigned powersj Apr 12, 2023
Copy link
Contributor

@powersj powersj left a comment

Choose a reason for hiding this comment

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

Thanks for coming around and wrapping this PR up!

Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

@varunjain0606 thanks for this great contribution! I do have some minor comments...

Additionally I think this PR count for at least three different ones, so please split those up next time as this also eases review...

plugins/inputs/kube_inventory/client.go Outdated Show resolved Hide resolved
plugins/inputs/kube_inventory/certificate.go Outdated Show resolved Hide resolved
plugins/inputs/kube_inventory/certificate.go Outdated Show resolved Hide resolved
plugins/inputs/kube_inventory/node.go Outdated Show resolved Hide resolved
plugins/inputs/kube_inventory/node.go Outdated Show resolved Hide resolved
@srebhan
Copy link
Member

srebhan commented Apr 26, 2023

@varunjain0606 can you please take a look at my comments!?

@srebhan srebhan added the waiting for response waiting for response from contributor label Apr 26, 2023
@telegraf-tiger
Copy link
Contributor

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 May 11, 2023
@powersj
Copy link
Contributor

powersj commented May 18, 2023

@varunjain0606 I thought you were pretty close to wrapping up this PR! Do you still want to wrap up @srebhan's comments and get this landed?

@telegraf-tiger telegraf-tiger bot removed the waiting for response waiting for response from contributor label May 18, 2023
@varunjain0606
Copy link
Contributor Author

@powersj @srebhan Sorry for such long delay. I feel terrible for making you wait. I have been busy with personal issues since past couple of weeks and want to apologize for that.
I will be submitting the changes required as per the comments over the weekend.

@powersj
Copy link
Contributor

powersj commented May 18, 2023

no worries :) I certainly didn't want to see this PR get dropped entirely. I will re-open it and feel free to update it as you have time.

@powersj powersj reopened this May 18, 2023
@telegraf-tiger
Copy link
Contributor

@varunjain0606
Copy link
Contributor Author

@powersj @srebhan Please have a look. I have addressed the review comments

Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks for your contribution and effort @varunjain0606!

@srebhan srebhan assigned powersj and unassigned srebhan May 19, 2023
@srebhan srebhan changed the title feat: extend kube_inventory plugin to include resourcequota,secrets measurement and extend node and pod measurement feat(inputs.kubernetes): Extend kube_inventory plugin to include resourcequota,secrets measurement and extend node and pod measurement May 19, 2023
@srebhan srebhan added area/k8s plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins labels May 19, 2023
@srebhan
Copy link
Member

srebhan commented May 19, 2023

@powersj assigning it back to you to have a final view after the changes...

Copy link
Contributor

@powersj powersj left a comment

Choose a reason for hiding this comment

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

Thank you!

@powersj powersj merged commit 1b74a25 into influxdata:master May 19, 2023
@srebhan srebhan added this to the v1.27.0 milestone Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/k8s feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants