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

Add cluster-info recording rule #931

Merged
merged 1 commit into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Add recording rules to list all clusters.

## [2.138.1] - 2023-10-11

### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,40 @@ spec:
record: aggregation:giantswarm:app_upgrade_available
- name: clusters.grafana-cloud.recording
rules:
# This recording rule is used to list all clusters. The last expression is used to list vintage MCs
- expr: |-
avg by (cluster_id, customer, installation) (
label_replace(
capi_cluster_info,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

CAPI clusters

"cluster_id",
"$1",
"name",
"(.*)"
) >= 1
or cluster_operator_cluster_status >= 1
or cluster_service_cluster_info >= 1
or
label_replace(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Management clusters

label_replace(
label_replace(
vector(1),
"cluster_id",
{{ .Values.managementCluster.name | quote }},
"",
""
),
"customer",
{{ .Values.managementCluster.customer | quote }},
"",
""
),
"installation",
{{ .Values.managementCluster.name | quote }},
"",
""
)
)
record: aggregation:giantswarm:cluster_info
- expr: sum(label_replace(azure_operator_cluster_release{release_version!=""}, "cluster_id", "$1", "exported_cluster_id", "(.*)")) by (release_version, cluster_id) or sum(cluster_service_cluster_info) by (release_version, cluster_id) / 2 or sum(cluster_operator_cluster_status{release_version!=""}) by (release_version, cluster_id)
record: aggregation:giantswarm:cluster_release_version
- expr: avg_over_time(cluster_operator_cluster_create_transition[1w]) or avg_over_time(azure_operator_cluster_create_transition[1w])
Expand Down
6 changes: 6 additions & 0 deletions helm/prometheus-rules/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"managementCluster": {
"type": "object",
"properties": {
"customer": {
"type": "string"
},
"name": {
"type": "string"
},
Expand All @@ -14,6 +17,9 @@
"provider": {
"type": "object",
"properties": {
"flavor": {
"type": "string"
},
"kind": {
"type": "string"
}
Expand Down
1 change: 1 addition & 0 deletions helm/prometheus-rules/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ project:
branch: '[[ .Branch ]]'
commit: '[[ .SHA ]]'
managementCluster:
customer: ""
name: ""
pipeline: ""
provider:
Expand Down
Loading