Skip to content

CP-23050: Validate CloudZero Metrics are available from Kube State Metrics#61

Closed
bdrennz wants to merge 8 commits intodevelopfrom
cp-23050
Closed

CP-23050: Validate CloudZero Metrics are available from Kube State Metrics#61
bdrennz wants to merge 8 commits intodevelopfrom
cp-23050

Conversation

@bdrennz
Copy link
Contributor

@bdrennz bdrennz commented Nov 22, 2024

This PR modifies the kube_state_metrics_reachable post-start job to also validate that all CloudZero KMS metrics are available. A sample log output:

{
  "level": "info",
  "log_sequence": 6,
  "msg": "Using endpoint URL: http://192.168.5.249:8080/metrics",     <---- Internal IP discovered using the Service Endpoint 
  "op": "ksm",
  "time": "2024-11-25T08:23:44Z"
}
{
  "level": "info",
  "log_sequence": 7,
  "msg": "All required metrics found: [kube_pod_info kube_node_info]",                <---- Metric Check (subset for now)
  "op": "ksm",
 }
 
Part of the Cluster Status Report related to KMS: {\"name\":\"kube_state_metrics_reachable\",\"passing\":true}]}",

namespace = "prom-agent"
serviceName = "cz-prom-agent-kube-state-metrics"
Copy link
Contributor Author

@bdrennz bdrennz Nov 22, 2024

Choose a reason for hiding this comment

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

Note: Need namespace and serviceName to be passed as args.

@bdrennz bdrennz changed the title CP-23050 CP-23050: Validate CloudZero Metrics are available from Kube State Metrics Nov 25, 2024
c.logger.Infof("Address: %v", address)
for _, port := range subset.Ports {
c.logger.Infof("Port: %v", port)
if port.Port == 8080 {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Port should be an arg

}

metrics := string(body)
requiredMetrics := []string{"kube_pod_info", "kube_node_info"} // Add the required metrics here
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: Pass all Chart metrics via validator config file

run: |
go test -timeout 30s -race -cover ./...
#go test -timeout 30s -race -cover ./...
go test -v ./pkg/diagnostic/kms/
Copy link
Contributor Author

Choose a reason for hiding this comment

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

note: Change back after testing

@bdrennz bdrennz closed this Nov 27, 2024
evan-cz pushed a commit that referenced this pull request Jan 13, 2025
evan-cz pushed a commit that referenced this pull request Apr 1, 2025
* Add sizing guide
* Update/Streamline README
josephbarnett added a commit that referenced this pull request Jul 25, 2025
* Add sizing guide
* Update/Streamline README
josephbarnett pushed a commit that referenced this pull request Jul 25, 2025
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.

1 participant