-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[receiver/k8sclusterreceiver] add HierarchicalResourceQuota #29673
[receiver/k8sclusterreceiver] add HierarchicalResourceQuota #29673
Conversation
263c955
to
29fad05
Compare
83b6ce9
to
478b4c5
Compare
ae3ec9c
to
2e8ce0f
Compare
2e8ce0f
to
c7ee961
Compare
Please code review. I'm sorry. The label pkg/stanza was given in error. Please remove that label. |
receiver/k8sclusterreceiver/internal/hierarchicalresourcequota/hierarchicalresourcequotas.go
Outdated
Show resolved
Hide resolved
d1ce42e
to
4d2b444
Compare
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
I think we are also missing some docs around how to use this / RBAC? :) Sorry for delayed reviews. I will try to also build this and test it early next week. |
Thank you for your reponse.
I missed writing docs about how to use and RBAC. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ok to me. @TylerHelmuth / @dmitryax would be great if you could take a look
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -497,3 +507,19 @@ metrics: | |||
|
|||
# k8s.node.allocatable_* metrics (k8s.node.allocatable_cpu, k8s.node.allocatable_memory, etc) are controlled | |||
# by allocatable_types_to_report config option. By default, none of them are reported. | |||
k8s.hierarchical_resource_quota.hard_limit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
k8s.hierarchical_resource_quota.hard_limit: | |
k8s.hierarchicalresourcequota.limit: |
This will keep the metric names in-line with the attr names which do not have underscore. Are we adding hard_limit
explicitly cause there is another type of limit with these (e.g. soft_limit)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I refer to the following lines.
Should I change that setting to 'limit'?
opentelemetry-collector-contrib/receiver/k8sclusterreceiver/metadata.yaml
Lines 418 to 433 in 6a0b248
k8s.resource_quota.hard_limit: | |
enabled: true | |
description: The upper limit for a particular resource in a specific namespace. Will only be sent if a quota is specified. CPU requests/limits will be sent as millicores | |
unit: "{resource}" | |
gauge: | |
value_type: int | |
attributes: | |
- resource | |
k8s.resource_quota.used: | |
enabled: true | |
description: The usage for a particular resource in a specific namespace. Will only be sent if a quota is specified. CPU requests/limits will be sent as millicores | |
unit: "{resource}" | |
gauge: | |
value_type: int | |
attributes: | |
- resource |
There is an interesting issue about building a way for users to monitor custom CRDS without us adding new dependencies in k8sclusterreceiver - #30655 Maybe we should pursue this instead? 🤔 |
Thank you for sharing the issue. It's OK to close this PR. |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
Closed as inactive. Feel free to reopen if this PR is still being worked on. |
Description:
Add hnc.x-k8s.io/v1alpha2 HierarchicalResourceQuota as a target for metrics collection (Optional)
https://github.com/kubernetes-sigs/hierarchical-namespaces
A custom controller of HierarchicalResourceQuota has no imformer.
So, I use dynamic informers to collect these metrics.
Link to tracking Issue:
#29555
Testing:
I tested to collect hrq metrics with k8sclusterreceiver and debugexporter in a k8s cluster which is installed HierarchicalResourceQuota
ut: Add test case to collect metrics from hrq in receiver/k8sclusterreceiver/receiver_test.go#TestReceiver
Documentation:
I added some options for hrq.
The default value of hrq sets false.