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

fix filter bug in dashboards #10199

Merged
merged 1 commit into from
Jun 17, 2024
Merged

fix filter bug in dashboards #10199

merged 1 commit into from
Jun 17, 2024

Conversation

ldpliu
Copy link
Contributor

@ldpliu ldpliu commented Jun 6, 2024

Type of change

Select the type of your PR

  • Bugfix
  1. kafka dashboard some panels can not filter by Broker.
图片
  1. zookeeper dashboard some pannels can not filter by Node
图片

Description

Please describe your pull request

Checklist

Please go through this checklist and make sure all applicable tasks have been done

  • Write tests
  • Make sure all tests pass
  • Update documentation
  • Check RBAC rights for Kubernetes / OpenShift roles
  • Try your changes from Pod inside your Kubernetes and OpenShift cluster, not just locally
  • Reference relevant issue(s) and close them after merging
  • Update CHANGELOG.md
  • Supply screenshots for visual changes, such as Grafana dashboards

Copy link
Member

@scholzj scholzj 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 the PR. Any changes to the dashboards have to be done to the packaging/ directory. The examples/ directory is updated only as part of an Strimzi release.

Comment on lines 111 to 112
$
kubectl exec -ti my-cluster-entity-operator-6879c6b9d9-ccldp -c topic-operator -- curl -s localhost:8080/metrics | grep strimzi.resources
Copy link
Member

Choose a reason for hiding this comment

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

This seems wrong?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This seems wrong?

Sorry, removed the change.

@ldpliu ldpliu force-pushed the fix-dashboard branch 2 times, most recently from 8f2a0af to d9f4c11 Compare June 6, 2024 23:47
@ldpliu ldpliu closed this Jun 7, 2024
@ldpliu ldpliu reopened this Jun 7, 2024
@fvaleri fvaleri self-requested a review June 8, 2024 13:50
Copy link
Contributor

@fvaleri fvaleri left a comment

Choose a reason for hiding this comment

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

@ldpliu I tried the new dashboards and they work fine, but you still have to revert changes in examples/ and helm-charts/ dirs. Just keep changes under packaging/ dir. Thanks.

Copy link
Member

Choose a reason for hiding this comment

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

As I said before, do not change this file.

Copy link
Member

Choose a reason for hiding this comment

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

As I said before, do not change this file.

Copy link
Member

Choose a reason for hiding this comment

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

As I said before, do not change this file.

Copy link
Member

Choose a reason for hiding this comment

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

As I said before, do not change this file.

@@ -1143,7 +1143,7 @@
"targets": [
{
"datasource": "${DS_PROMETHEUS}",
"expr": "sum(jvm_memory_used_bytes{namespace=\"$kubernetes_namespace\",kubernetes_pod_name=~\"$strimzi_cluster_name-$kafka_broker\",strimzi_io_name=\"$strimzi_cluster_name-kafka\"}) by (kubernetes_pod_name)",
"expr": "sum(jvm_memory_bytes_used{namespace=\"$kubernetes_namespace\",kubernetes_pod_name=~\"$strimzi_cluster_name-$kafka_broker\",strimzi_io_name=\"$strimzi_cluster_name-kafka\"}) by (kubernetes_pod_name)",
Copy link
Member

Choose a reason for hiding this comment

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

This change needs to be reverted.

@@ -1007,7 +1007,7 @@
"targets": [
{
"datasource": "${DS_PROMETHEUS}",
"expr": "sum(jvm_memory_used_bytes{namespace=\"$kubernetes_namespace\",kubernetes_pod_name=~\"$strimzi_cluster_name-$zk_node\",strimzi_io_name=\"$strimzi_cluster_name-zookeeper\"}) by (kubernetes_pod_name)",
"expr": "sum(jvm_memory_bytes_used{namespace=\"$kubernetes_namespace\",kubernetes_pod_name=~\"$strimzi_cluster_name-$zk_node\",strimzi_io_name=\"$strimzi_cluster_name-zookeeper\"}) by (kubernetes_pod_name)",
Copy link
Member

Choose a reason for hiding this comment

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

This change needs to be reverted.

@@ -1143,7 +1143,7 @@
"targets": [
{
"datasource": "${DS_PROMETHEUS}",
"expr": "sum(jvm_memory_used_bytes{namespace=\"$kubernetes_namespace\",kubernetes_pod_name=~\"$strimzi_cluster_name-$kafka_broker\",strimzi_io_name=\"$strimzi_cluster_name-kafka\"}) by (kubernetes_pod_name)",
"expr": "sum(jvm_memory_bytes_used{namespace=\"$kubernetes_namespace\",kubernetes_pod_name=~\"$strimzi_cluster_name-$kafka_broker\",strimzi_io_name=\"$strimzi_cluster_name-kafka\"}) by (kubernetes_pod_name)",
Copy link
Member

Choose a reason for hiding this comment

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

This change needs to be reverted.

@@ -1007,7 +1007,7 @@
"targets": [
{
"datasource": "${DS_PROMETHEUS}",
"expr": "sum(jvm_memory_used_bytes{namespace=\"$kubernetes_namespace\",kubernetes_pod_name=~\"$strimzi_cluster_name-$zk_node\",strimzi_io_name=\"$strimzi_cluster_name-zookeeper\"}) by (kubernetes_pod_name)",
"expr": "sum(jvm_memory_bytes_used{namespace=\"$kubernetes_namespace\",kubernetes_pod_name=~\"$strimzi_cluster_name-$zk_node\",strimzi_io_name=\"$strimzi_cluster_name-zookeeper\"}) by (kubernetes_pod_name)",
Copy link
Member

Choose a reason for hiding this comment

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

This change needs to be reverted.

@@ -960,7 +960,7 @@
"targets": [
{
"datasource": "${DS_PROMETHEUS}",
"expr": "sum(kubelet_volume_stats_available_bytes{namespace=\"$kubernetes_namespace\",persistentvolumeclaim=~\"data(-[0-9]+)?-$strimzi_cluster_name-(kafka|$pool_name)-[0-9]+\"}) by (persistentvolumeclaim)",
"expr": "sum(kubelet_volume_stats_available_bytes{namespace=\"$kubernetes_namespace\",persistentvolumeclaim=~\"data(-[0-9]+)?-$strimzi_cluster_name-$kafka_broker\"}) by (persistentvolumeclaim)",
Copy link
Member

Choose a reason for hiding this comment

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

How does this work with node pools as you are replacing the pool name?

Also, I guess this change should be done to the KRaft dashboard as well?

Copy link
Contributor Author

@ldpliu ldpliu Jun 11, 2024

Choose a reason for hiding this comment

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

The $kafka_broker will change based on the pool/node. So the pvc name should be: data(-[0-9]+)?-$strimzi_cluster_name-$kafka_broker
Also changed it in kraft dashboard
strimzi-kafka

Copy link
Member

Choose a reason for hiding this comment

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

But it defaults to something like .* => so that surely doesn't work the same way as what was there. It should be now matching all PVCs which seems more wrong then ignoring the broker selector. Or how does it filter out non-Kafka PVCs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But it defaults to something like .* => so that surely doesn't work the same way as what was there. It should be now matching all PVCs which seems more wrong then ignoring the broker selector. Or how does it filter out non-Kafka PVCs?

I am not really understand what you mean. The current filter should works. It only filter the pvcs which has name: data(-[0-9]+)?-$strimzi_cluster_name-$kafka_broker

image

Copy link
Member

Choose a reason for hiding this comment

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

But when no broker is selected, it would pick something like this data(-[0-9]+)?-$strimzi_cluster_name-.* and that should pick for example ZooKeeper volumes in Kafka dashboard and vice versa.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How about this?
kubelet_volume_stats_available_bytes{namespace="multicluster-global-hub",persistentvolumeclaim=~"data(-[0-9]+)?-my-cluster-.*",persistentvolumeclaim!~".*zookeeper(-[0-9]+)?$"}

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure if that would work in all environments. If yes, it might be an option I guess.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed the code to use kubelet_volume_stats_available_bytes{namespace="multicluster-global-hub",persistentvolumeclaim=~"data(-[0-9]+)?-my-cluster-.*",persistentvolumeclaim!~".*zookeeper(-[0-9]+)?$"} please help to review again.

@scholzj scholzj added this to the 0.42.0 milestone Jun 11, 2024
@ldpliu ldpliu force-pushed the fix-dashboard branch 2 times, most recently from 48c86dd to daf94c9 Compare June 12, 2024 06:04
Copy link
Member

@scholzj scholzj left a comment

Choose a reason for hiding this comment

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

@Frawless @im-konge Do you have any environment where you can try it - especially the Available Disk Space with various configurations? I cannot try it right now as I'm traveling until next week.

@scholzj
Copy link
Member

scholzj commented Jun 12, 2024

I guess the pool_name variable is not used anymore and assuming the current code works it can be removed?

@ldpliu
Copy link
Contributor Author

ldpliu commented Jun 12, 2024

I guess the pool_name variable is not used anymore and assuming the current code works it can be removed?

You are right. Removed

@@ -329,7 +329,7 @@
"targets": [
{
"datasource": "${DS_PROMETHEUS}",
"expr": "sum(kubelet_volume_stats_available_bytes{namespace=\"$kubernetes_namespace\",persistentvolumeclaim=~\"data(-[0-9]+)?-$strimzi_cluster_name-(kafka|$pool_name)-[0-9]+\"}) by (persistentvolumeclaim)",
"expr": "sum(kubelet_volume_stats_available_bytes{namespace=\"$kubernetes_namespace\",persistentvolumeclaim=~\"data(-[0-9]+)?-$strimzi_cluster_name-$kafka_broker\", persistentvolumeclaim!~\".*zookeeper(-[0-9]+)?$\"}) by (persistentvolumeclaim)",
Copy link
Member

Choose a reason for hiding this comment

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

I gave this a try. The KRaft dashboard is not using $kafka_broker but $kraft_node. Could you please fix this?

Copy link
Member

Choose a reason for hiding this comment

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

(the same is of course also in the Helm Chart dashboard)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I gave this a try. The KRaft dashboard is not using $kafka_broker but $kraft_node. Could you please fix this?

Changed, please help to try again

@Frawless
Copy link
Member

@Frawless @im-konge Do you have any environment where you can try it - especially the Available Disk Space with various configurations? I cannot try it right now as I'm traveling until next week.

hey, sorry for delay, I just tried the changes and all of them works fine for my deployment. I used latest changes that were committed today.

@scholzj scholzj merged commit 654cd6d into strimzi:main Jun 17, 2024
13 checks passed
@scholzj
Copy link
Member

scholzj commented Jun 17, 2024

Thanks for the PR @ldpliu

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.

5 participants