Skip to content

fix: "Cluster Deployments Events" dashboard vs "From Management to Regional" case#469

Merged
denis-ryzhkov merged 1 commit into
k0rdent:mainfrom
denis-ryzhkov:fix-cluster-deployment-events-vs-from-mgmt-to-regional
Aug 8, 2025
Merged

fix: "Cluster Deployments Events" dashboard vs "From Management to Regional" case#469
denis-ryzhkov merged 1 commit into
k0rdent:mainfrom
denis-ryzhkov:fix-cluster-deployment-events-vs-from-mgmt-to-regional

Conversation

@denis-ryzhkov
Copy link
Copy Markdown
Collaborator

@denis-ryzhkov denis-ryzhkov commented Aug 8, 2025

  • From Management to Regional case means:
    metrics, logs, and traces from management cluster are sent to regional cluster.
  • "Cluster Deployments Events" dashboard stopped supporting this case
    after PR fix: Prevent regional clusters selection from cluster-deployments-events dashboard #418
    which added /^logs$/ regex matching only GrafanaDatasource named exactly logs as in From Management to Management case.
  • That PR tried to fix the issue Prevent regional clusters selection from cluster-deployments-events dashboard #406
    where selecting a regional datasource in this dashboard lead to Status: 500.
  • Investigating this error deeper:
    Status: 500. Message: error from datasource: ...
    cannot parse query [
      k8s.namespace.name:~".*"
      | unpack_json from regarding result_prefix "regarding_"
      | unpack_json from metadata result_prefix "metadata_"
      | regarding_kind:*
      | regarding_name:
      | metadata_annotations.generation:*
    ]:
    
    unexpected pipe "regarding_name";
    
  • So the | regarding_name: without a value is an invalid query syntax.
  • It was caused by the | regarding_name:$cluster_deployment variable expansion.
  • Current PR fixes it to be | regarding_name:~"$cluster_deployment"
    unlike | regarding_name:~"^${cluster_deployment}(-md-.*|-cp-.*)?$"
    introduced later in feat: Add cluster filter to Victoria Logs dashboard #382
    because e.g. the valuable informative regarding_kind: ClusterSummary
    has the not matching regarding_name: kof-regional-cluster-capi-$cluster_deployment
    and other kinds may contain the $cluster_deployment name in a different way.
  • This also allows to re-enable multi-selection of ClusterDeployments.
  • Also porting event.name:* primary filter for performance to 1.1.0.
  • Also fixed the issue with folder naming in main:
    kubectl get GrafanaDashboard -n kof cluster-deployment-events -o yaml | yq .status
    
    conditions:
      - message: |-
          Dashboard failed to be applied for 1 out of 1 instances. Errors:
          - kof/grafana-vm: [POST /folders][400] createFolderBadRequest {"message":
          "Folder name cannot be the same as one of its dashboards"}
        reason: ApplyFailed
    
  • Fix in release/v1.1.0 branch - c9483e2
  • Fix in main - this PR.
  • As a result the "From Management to Regional" case, ClusterSummary and other kinds are supported now.

1.1.0:

1-1-0

main:

main

denis-ryzhkov added a commit that referenced this pull request Aug 8, 2025
@denis-ryzhkov denis-ryzhkov marked this pull request as ready for review August 8, 2025 15:36
Copy link
Copy Markdown
Collaborator

@gmlexx gmlexx left a comment

Choose a reason for hiding this comment

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

Please back md and cp suffixes in regexp

@denis-ryzhkov denis-ryzhkov requested a review from gmlexx August 8, 2025 15:53
@denis-ryzhkov denis-ryzhkov force-pushed the fix-cluster-deployment-events-vs-from-mgmt-to-regional branch from 4a1b767 to b739f44 Compare August 8, 2025 16:35
@denis-ryzhkov denis-ryzhkov merged commit 2d6104b into k0rdent:main Aug 8, 2025
6 checks passed
@github-project-automation github-project-automation Bot moved this to Done in k0rdent Aug 8, 2025
denis-ryzhkov added a commit that referenced this pull request Aug 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants