From 9980e6677f6c2ab5a7e6797f013ffd92505dc826 Mon Sep 17 00:00:00 2001 From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com> Date: Tue, 5 Mar 2024 15:52:02 +0100 Subject: [PATCH] [Feature] Deployment & Members Condition metrics (#1610) --- CHANGELOG.md | 1 + docs/generated/metrics/README.md | 2 + ...arangodb_operator_deployment_conditions.md | 19 ++++ .../arangodb_operator_members_conditions.md | 20 ++++ internal/metrics.go.tmpl | 2 +- internal/metrics.item.go.tmpl | 2 +- internal/metrics.yaml | 25 +++++ pkg/deployment/deployment_inspector.go | 17 ++++ pkg/deployment/metrics.go | 7 +- pkg/deployment/metrics_conditions.go | 93 +++++++++++++++++++ .../reconcile/plan_builder_rotate_upgrade.go | 13 ++- ...db_operator_agency_cache_health_present.go | 2 +- .../arangodb_operator_agency_cache_healthy.go | 2 +- .../arangodb_operator_agency_cache_leaders.go | 2 +- ...rator_agency_cache_member_commit_offset.go | 2 +- ...db_operator_agency_cache_member_serving.go | 2 +- .../arangodb_operator_agency_cache_present.go | 2 +- .../arangodb_operator_agency_cache_serving.go | 2 +- .../arangodb_operator_agency_errors.go | 2 +- .../arangodb_operator_agency_fetches.go | 2 +- .../arangodb_operator_agency_index.go | 2 +- ...arangodb_operator_deployment_conditions.go | 39 ++++++++ .../arangodb_operator_engine_assertions.go | 2 +- .../arangodb_operator_engine_ops_alerts.go | 2 +- ...angodb_operator_engine_panics_recovered.go | 2 +- ...erator_kubernetes_client_request_errors.go | 2 +- ...odb_operator_kubernetes_client_requests.go | 2 +- .../arangodb_operator_members_conditions.go | 39 ++++++++ ...members_unexpected_container_exit_codes.go | 2 +- .../arangodb_operator_rebalancer_enabled.go | 2 +- ...ngodb_operator_rebalancer_moves_current.go | 2 +- ...angodb_operator_rebalancer_moves_failed.go | 2 +- ...odb_operator_rebalancer_moves_generated.go | 2 +- ...odb_operator_rebalancer_moves_succeeded.go | 2 +- ...tor_resources_arangodeployment_accepted.go | 2 +- ...urces_arangodeployment_immutable_errors.go | 2 +- ...r_resources_arangodeployment_propagated.go | 2 +- ...ources_arangodeployment_status_restores.go | 2 +- ...tor_resources_arangodeployment_uptodate.go | 2 +- ...rces_arangodeployment_validation_errors.go | 2 +- ...rces_arangodeploymentreplication_active.go | 2 +- ...rces_arangodeploymentreplication_failed.go | 2 +- pkg/generated/metric_descriptions/metrics.go | 2 +- 43 files changed, 304 insertions(+), 35 deletions(-) create mode 100644 docs/generated/metrics/arangodb_operator_deployment_conditions.md create mode 100644 docs/generated/metrics/arangodb_operator_members_conditions.md create mode 100644 pkg/deployment/metrics_conditions.go create mode 100644 pkg/generated/metric_descriptions/arangodb_operator_deployment_conditions.go create mode 100644 pkg/generated/metric_descriptions/arangodb_operator_members_conditions.go diff --git a/CHANGELOG.md b/CHANGELOG.md index f4686c82c..5c5cda6df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - (Feature) JobScheduler Volumes, Probes, Lifecycle and Ports integration - (Feature) Merge ArangoDB Usage Metrics - (Bugfix) Check Connection to the ArangoDB before creating Backup +- (Feature) Deployment & Members Condition metrics ## [1.2.38](https://github.com/arangodb/kube-arangodb/tree/1.2.38) (2024-02-22) - (Feature) Extract GRPC Server diff --git a/docs/generated/metrics/README.md b/docs/generated/metrics/README.md index 1a1e98b03..864fed6af 100644 --- a/docs/generated/metrics/README.md +++ b/docs/generated/metrics/README.md @@ -24,11 +24,13 @@ has_toc: false | [arangodb_operator_agency_cache_member_serving](./arangodb_operator_agency_cache_member_serving.md) | arangodb_operator | agency_cache | Gauge | Determines if agency member is reachable | | [arangodb_operator_agency_cache_present](./arangodb_operator_agency_cache_present.md) | arangodb_operator | agency_cache | Gauge | Determines if local agency cache is present | | [arangodb_operator_agency_cache_serving](./arangodb_operator_agency_cache_serving.md) | arangodb_operator | agency_cache | Gauge | Determines if agency is serving | +| [arangodb_operator_deployment_conditions](./arangodb_operator_deployment_conditions.md) | arangodb_operator | deployment | Gauge | Representation of the ArangoDeployment condition state (true/false) | | [arangodb_operator_engine_assertions](./arangodb_operator_engine_assertions.md) | arangodb_operator | engine | Counter | Number of assertions invoked during Operator runtime | | [arangodb_operator_engine_ops_alerts](./arangodb_operator_engine_ops_alerts.md) | arangodb_operator | engine | Counter | Counter for actions which requires ops attention | | [arangodb_operator_engine_panics_recovered](./arangodb_operator_engine_panics_recovered.md) | arangodb_operator | engine | Counter | Number of Panics recovered inside Operator reconciliation loop | | [arangodb_operator_kubernetes_client_request_errors](./arangodb_operator_kubernetes_client_request_errors.md) | arangodb_operator | kubernetes_client | Counter | Number of Kubernetes Client request errors | | [arangodb_operator_kubernetes_client_requests](./arangodb_operator_kubernetes_client_requests.md) | arangodb_operator | kubernetes_client | Counter | Number of Kubernetes Client requests | +| [arangodb_operator_members_conditions](./arangodb_operator_members_conditions.md) | arangodb_operator | members | Gauge | Representation of the ArangoMember condition state (true/false) | | [arangodb_operator_members_unexpected_container_exit_codes](./arangodb_operator_members_unexpected_container_exit_codes.md) | arangodb_operator | members | Counter | Counter of unexpected restarts in pod (Containers/InitContainers/EphemeralContainers) | | [arangodb_operator_rebalancer_enabled](./arangodb_operator_rebalancer_enabled.md) | arangodb_operator | rebalancer | Gauge | Determines if rebalancer is enabled | | [arangodb_operator_rebalancer_moves_current](./arangodb_operator_rebalancer_moves_current.md) | arangodb_operator | rebalancer | Gauge | Define how many moves are currently in progress | diff --git a/docs/generated/metrics/arangodb_operator_deployment_conditions.md b/docs/generated/metrics/arangodb_operator_deployment_conditions.md new file mode 100644 index 000000000..c868006b6 --- /dev/null +++ b/docs/generated/metrics/arangodb_operator_deployment_conditions.md @@ -0,0 +1,19 @@ +--- +layout: page +title: arangodb_operator_deployment_conditions +parent: List of available metrics +--- + +# arangodb_operator_deployment_conditions (Gauge) + +## Description + +Representation of the ArangoDeployment condition state (true/false) + +## Labels + +| Label | Description | +|:---------:|:---------------------| +| namespace | Deployment Namespace | +| name | Deployment Name | +| condition | Condition Name | diff --git a/docs/generated/metrics/arangodb_operator_members_conditions.md b/docs/generated/metrics/arangodb_operator_members_conditions.md new file mode 100644 index 000000000..43084b4ab --- /dev/null +++ b/docs/generated/metrics/arangodb_operator_members_conditions.md @@ -0,0 +1,20 @@ +--- +layout: page +title: arangodb_operator_members_conditions +parent: List of available metrics +--- + +# arangodb_operator_members_conditions (Gauge) + +## Description + +Representation of the ArangoMember condition state (true/false) + +## Labels + +| Label | Description | +|:---------:|:---------------------| +| namespace | Deployment Namespace | +| name | Deployment Name | +| member | Member ID | +| condition | Condition Name | diff --git a/internal/metrics.go.tmpl b/internal/metrics.go.tmpl index 102ac012c..325af68c3 100644 --- a/internal/metrics.go.tmpl +++ b/internal/metrics.go.tmpl @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/metrics.item.go.tmpl b/internal/metrics.item.go.tmpl index bc0856c02..47156c510 100644 --- a/internal/metrics.item.go.tmpl +++ b/internal/metrics.item.go.tmpl @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/internal/metrics.yaml b/internal/metrics.yaml index 39e6dc02e..18c66c464 100644 --- a/internal/metrics.yaml +++ b/internal/metrics.yaml @@ -219,6 +219,18 @@ namespaces: description: "DeploymentReplication Namespace" - key: name description: "DeploymentReplication Name" + deployment: + conditions: + shortDescription: "Representation of the ArangoDeployment condition state (true/false)" + description: "Representation of the ArangoDeployment condition state (true/false)" + type: "Gauge" + labels: + - key: namespace + description: "Deployment Namespace" + - key: name + description: "Deployment Name" + - key: condition + description: "Condition Name" members: unexpected_container_exit_codes: shortDescription: "Counter of unexpected restarts in pod (Containers/InitContainers/EphemeralContainers)" @@ -239,6 +251,19 @@ namespaces: description: "ExitCode" - key: reason description: "Reason" + conditions: + shortDescription: "Representation of the ArangoMember condition state (true/false)" + description: "Representation of the ArangoMember condition state (true/false)" + type: "Gauge" + labels: + - key: namespace + description: "Deployment Namespace" + - key: name + description: "Deployment Name" + - key: member + description: "Member ID" + - key: condition + description: "Condition Name" engine: panics_recovered: shortDescription: "Number of Panics recovered inside Operator reconciliation loop" diff --git a/pkg/deployment/deployment_inspector.go b/pkg/deployment/deployment_inspector.go index 6c13bec99..ce69feee7 100644 --- a/pkg/deployment/deployment_inspector.go +++ b/pkg/deployment/deployment_inspector.go @@ -153,6 +153,18 @@ func (d *Deployment) inspectDeployment(lastInterval util.Interval) util.Interval d.metrics.Deployment.Propagated = updated.Status.Conditions.IsTrue(api.ConditionTypeSpecPropagated) d.metrics.Deployment.UpToDate = updated.Status.Conditions.IsTrue(api.ConditionTypeUpToDate) + d.metrics.Conditions.RefreshDeployment(updated.Status.Conditions, + api.ConditionTypeSpecAccepted, + api.ConditionTypeSpecPropagated, + api.ConditionTypeUpToDate) + + d.metrics.Conditions.RefreshMembers(updated.Status.Members.AsList(), + api.ConditionTypeServing, + api.ConditionTypeScheduled, + api.ConditionTypeReachable, + api.ConditionTypeStarted, + api.ConditionTypeReady) + // Is the deployment in failed state, if so, give up. if d.GetPhase() == api.DeploymentPhaseFailed { d.log.Debug("Deployment is in Failed state.") @@ -482,6 +494,11 @@ func (d *Deployment) isUpToDateStatus(status api.DeploymentStatus) (upToDate boo reason = "PVC is resizing" return } + if !member.Conditions.IsTrue(api.ConditionTypeReady) { + upToDate = false + reason = "Not all members are ready" + return + } } return diff --git a/pkg/deployment/metrics.go b/pkg/deployment/metrics.go index 55081ccc6..64db289f4 100644 --- a/pkg/deployment/metrics.go +++ b/pkg/deployment/metrics.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -41,6 +41,8 @@ type Metrics struct { Deployment struct { Accepted, UpToDate, Propagated bool } + + Conditions ConditionsMetrics } func (d *Deployment) CollectMetrics(m metrics.PushMetric) { @@ -90,4 +92,7 @@ func (d *Deployment) CollectMetrics(m metrics.PushMetric) { if r := d.resources; r != nil { r.CollectMetrics(m) } + + // Conditions + d.metrics.Conditions.CollectMetrics(d.namespace, d.name, m) } diff --git a/pkg/deployment/metrics_conditions.go b/pkg/deployment/metrics_conditions.go new file mode 100644 index 000000000..0b88ed33f --- /dev/null +++ b/pkg/deployment/metrics_conditions.go @@ -0,0 +1,93 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Copyright holder is ArangoDB GmbH, Cologne, Germany +// + +package deployment + +import ( + "sync" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/generated/metric_descriptions" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/metrics" +) + +type ConditionsMetricsMap map[api.ConditionType]bool + +type ConditionsMetrics struct { + lock sync.Mutex + + conditions ConditionsMetricsMap + + memberConditions map[string]ConditionsMetricsMap +} + +func (c *ConditionsMetrics) CollectMetrics(namespace, name string, m metrics.PushMetric) { + c.lock.Lock() + defer c.lock.Unlock() + + for k, v := range c.conditions { + m.Push(metric_descriptions.ArangodbOperatorDeploymentConditionsGauge(util.BoolSwitch[float64](v, 1, 0), namespace, name, string(k))) + } + + for member := range c.memberConditions { + for k, v := range c.memberConditions[member] { + m.Push(metric_descriptions.ArangodbOperatorMembersConditionsGauge(util.BoolSwitch[float64](v, 1, 0), namespace, name, member, string(k))) + } + } +} + +func (c *ConditionsMetrics) RefreshDeployment(conditions api.ConditionList, types ...api.ConditionType) { + c.lock.Lock() + defer c.lock.Unlock() + + c.conditions = c.extractConditionsMap(conditions, types...) +} + +func (c *ConditionsMetrics) RefreshMembers(members api.DeploymentStatusMemberElements, types ...api.ConditionType) { + c.lock.Lock() + defer c.lock.Unlock() + + if len(members) == 0 { + c.memberConditions = nil + return + } + + ret := make(map[string]ConditionsMetricsMap, len(members)) + + for _, member := range members { + ret[member.Member.ID] = c.extractConditionsMap(member.Member.Conditions, types...) + } + + c.memberConditions = ret +} + +func (c *ConditionsMetrics) extractConditionsMap(conditions api.ConditionList, types ...api.ConditionType) ConditionsMetricsMap { + if len(types) == 0 { + return nil + } + + ret := make(ConditionsMetricsMap, len(types)) + for _, t := range types { + ret[t] = conditions.IsTrue(t) + } + + return ret +} diff --git a/pkg/deployment/reconcile/plan_builder_rotate_upgrade.go b/pkg/deployment/reconcile/plan_builder_rotate_upgrade.go index 23c9e0b11..acda2247f 100644 --- a/pkg/deployment/reconcile/plan_builder_rotate_upgrade.go +++ b/pkg/deployment/reconcile/plan_builder_rotate_upgrade.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -466,6 +466,8 @@ func groupReadyForRestart(context PlanBuilderContext, status api.DeploymentStatu return true, "Bootstrap not completed, restart is allowed" } + members := status.Members.MembersOfGroup(group) + // If current member did not become ready even once. Kill it if !member.Conditions.IsTrue(api.ConditionTypeStarted) { return true, "Member is not started" @@ -476,10 +478,17 @@ func groupReadyForRestart(context PlanBuilderContext, status api.DeploymentStatu return true, "Member is not serving" } - if !status.Members.MembersOfGroup(group).AllMembersServing() { + if !members.AllMembersServing() { return false, "Not all members are serving" } + if member.Conditions.IsTrue(api.ConditionTypeReady) { + // Our pod is ready, lets check other pods + if !members.AllMembersReady() { + return false, "Not all members are ready" + } + } + switch group { case api.ServerGroupDBServers: agencyState, ok := context.GetAgencyCache() diff --git a/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_health_present.go b/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_health_present.go index a0b4f50fe..c50fe4520 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_health_present.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_health_present.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_healthy.go b/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_healthy.go index b01a59355..75f645dfe 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_healthy.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_healthy.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_leaders.go b/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_leaders.go index 2bb0880a4..6833d5a42 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_leaders.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_leaders.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_member_commit_offset.go b/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_member_commit_offset.go index f5125f57b..bcd557ae7 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_member_commit_offset.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_member_commit_offset.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_member_serving.go b/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_member_serving.go index d3216f405..05e296c8e 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_member_serving.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_member_serving.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_present.go b/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_present.go index 3b0e7bc35..0d138dfe4 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_present.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_present.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_serving.go b/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_serving.go index b62aa917f..62865a000 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_serving.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_agency_cache_serving.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/generated/metric_descriptions/arangodb_operator_agency_errors.go b/pkg/generated/metric_descriptions/arangodb_operator_agency_errors.go index b2d04e324..609e99964 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_agency_errors.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_agency_errors.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/generated/metric_descriptions/arangodb_operator_agency_fetches.go b/pkg/generated/metric_descriptions/arangodb_operator_agency_fetches.go index 07f65ac99..30f511443 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_agency_fetches.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_agency_fetches.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/generated/metric_descriptions/arangodb_operator_agency_index.go b/pkg/generated/metric_descriptions/arangodb_operator_agency_index.go index 1d9b7a6ce..ba65aed5e 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_agency_index.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_agency_index.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/generated/metric_descriptions/arangodb_operator_deployment_conditions.go b/pkg/generated/metric_descriptions/arangodb_operator_deployment_conditions.go new file mode 100644 index 000000000..1ed17ab63 --- /dev/null +++ b/pkg/generated/metric_descriptions/arangodb_operator_deployment_conditions.go @@ -0,0 +1,39 @@ +// +// DISCLAIMER +// +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Copyright holder is ArangoDB GmbH, Cologne, Germany +// + +package metric_descriptions + +import "github.com/arangodb/kube-arangodb/pkg/util/metrics" + +var ( + arangodbOperatorDeploymentConditions = metrics.NewDescription("arangodb_operator_deployment_conditions", "Representation of the ArangoDeployment condition state (true/false)", []string{`namespace`, `name`, `condition`}, nil) +) + +func init() { + registerDescription(arangodbOperatorDeploymentConditions) +} + +func ArangodbOperatorDeploymentConditions() metrics.Description { + return arangodbOperatorDeploymentConditions +} + +func ArangodbOperatorDeploymentConditionsGauge(value float64, namespace string, name string, condition string) metrics.Metric { + return ArangodbOperatorDeploymentConditions().Gauge(value, namespace, name, condition) +} diff --git a/pkg/generated/metric_descriptions/arangodb_operator_engine_assertions.go b/pkg/generated/metric_descriptions/arangodb_operator_engine_assertions.go index 76a8c1fb9..31f412c04 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_engine_assertions.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_engine_assertions.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/generated/metric_descriptions/arangodb_operator_engine_ops_alerts.go b/pkg/generated/metric_descriptions/arangodb_operator_engine_ops_alerts.go index d92697f00..d397c47c8 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_engine_ops_alerts.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_engine_ops_alerts.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/generated/metric_descriptions/arangodb_operator_engine_panics_recovered.go b/pkg/generated/metric_descriptions/arangodb_operator_engine_panics_recovered.go index bb0a80ac2..a412f8022 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_engine_panics_recovered.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_engine_panics_recovered.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/generated/metric_descriptions/arangodb_operator_kubernetes_client_request_errors.go b/pkg/generated/metric_descriptions/arangodb_operator_kubernetes_client_request_errors.go index 44c5d397c..8ecf33823 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_kubernetes_client_request_errors.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_kubernetes_client_request_errors.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/generated/metric_descriptions/arangodb_operator_kubernetes_client_requests.go b/pkg/generated/metric_descriptions/arangodb_operator_kubernetes_client_requests.go index 940442d0a..be5e640a9 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_kubernetes_client_requests.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_kubernetes_client_requests.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/generated/metric_descriptions/arangodb_operator_members_conditions.go b/pkg/generated/metric_descriptions/arangodb_operator_members_conditions.go new file mode 100644 index 000000000..ff4782e87 --- /dev/null +++ b/pkg/generated/metric_descriptions/arangodb_operator_members_conditions.go @@ -0,0 +1,39 @@ +// +// DISCLAIMER +// +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Copyright holder is ArangoDB GmbH, Cologne, Germany +// + +package metric_descriptions + +import "github.com/arangodb/kube-arangodb/pkg/util/metrics" + +var ( + arangodbOperatorMembersConditions = metrics.NewDescription("arangodb_operator_members_conditions", "Representation of the ArangoMember condition state (true/false)", []string{`namespace`, `name`, `member`, `condition`}, nil) +) + +func init() { + registerDescription(arangodbOperatorMembersConditions) +} + +func ArangodbOperatorMembersConditions() metrics.Description { + return arangodbOperatorMembersConditions +} + +func ArangodbOperatorMembersConditionsGauge(value float64, namespace string, name string, member string, condition string) metrics.Metric { + return ArangodbOperatorMembersConditions().Gauge(value, namespace, name, member, condition) +} diff --git a/pkg/generated/metric_descriptions/arangodb_operator_members_unexpected_container_exit_codes.go b/pkg/generated/metric_descriptions/arangodb_operator_members_unexpected_container_exit_codes.go index 33850f3c3..9d0bfbad1 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_members_unexpected_container_exit_codes.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_members_unexpected_container_exit_codes.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_enabled.go b/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_enabled.go index 4d5883b97..8347d6180 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_enabled.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_enabled.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_current.go b/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_current.go index ba37ee7c1..e96c3846a 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_current.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_current.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_failed.go b/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_failed.go index c1b2349d5..6131f8336 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_failed.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_failed.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_generated.go b/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_generated.go index 9081f8e0c..ef4b2b714 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_generated.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_generated.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_succeeded.go b/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_succeeded.go index a7e5de681..363734764 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_succeeded.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_rebalancer_moves_succeeded.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_accepted.go b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_accepted.go index 2a3f5f7f5..b1c1f2acb 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_accepted.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_accepted.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_immutable_errors.go b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_immutable_errors.go index dfbfd73bc..b31f1bb31 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_immutable_errors.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_immutable_errors.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_propagated.go b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_propagated.go index 696a4e02f..431071c74 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_propagated.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_propagated.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_status_restores.go b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_status_restores.go index 738ca571c..c615b99d5 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_status_restores.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_status_restores.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_uptodate.go b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_uptodate.go index f94268877..a08da9815 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_uptodate.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_uptodate.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_validation_errors.go b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_validation_errors.go index 2d0dd58da..3517f672a 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_validation_errors.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeployment_validation_errors.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeploymentreplication_active.go b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeploymentreplication_active.go index 6aca55ea7..57288aede 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeploymentreplication_active.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeploymentreplication_active.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeploymentreplication_failed.go b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeploymentreplication_failed.go index 6307dd89b..b5f95c3bf 100644 --- a/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeploymentreplication_failed.go +++ b/pkg/generated/metric_descriptions/arangodb_operator_resources_arangodeploymentreplication_failed.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/generated/metric_descriptions/metrics.go b/pkg/generated/metric_descriptions/metrics.go index 6153ae1f0..edff727c3 100644 --- a/pkg/generated/metric_descriptions/metrics.go +++ b/pkg/generated/metric_descriptions/metrics.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License.