forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cloud,backupccl: add metric for time of last backup failure due to KMS
Add a metric `backup.last-failed-time.kms-inaccessible` that tracks the timestamp of the last backup failure due to a KMS error. This metric is only tracked for BACKUP statrements that are executed with the OPTION `updates_cluster_monitoring_metrics` set. Release note (sql change): adds the `updates_cluster_monitoring_metrics` backup option that allows an operator to opt-in tracking the timestamp of the last backup failure due to a KMS error.
- Loading branch information
Rui Hu
committed
Sep 26, 2023
1 parent
5d61611
commit 2ad9e79
Showing
31 changed files
with
551 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// Copyright 2023 The Cockroach Authors. | ||
// | ||
// Licensed as a CockroachDB Enterprise file under the Cockroach Community | ||
// License (the "License"); you may not use this file except in compliance with | ||
// the License. You may obtain a copy of the License at | ||
// | ||
// https://github.com/cockroachdb/cockroach/blob/master/licenses/CCL.txt | ||
|
||
package backupccl | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/cockroachdb/cockroach/pkg/jobs" | ||
"github.com/cockroachdb/cockroach/pkg/util/metric" | ||
) | ||
|
||
type BackupMetrics struct { | ||
LastKMSInaccessibleErrorTime *metric.Gauge | ||
} | ||
|
||
// MetricStruct implements the metric.Struct interface. | ||
func (b BackupMetrics) MetricStruct() {} | ||
|
||
// MakeBackupMetrics instantiates the metrics for backup. | ||
func MakeBackupMetrics(time.Duration) metric.Struct { | ||
m := &BackupMetrics{ | ||
LastKMSInaccessibleErrorTime: metric.NewGauge(metric.Metadata{ | ||
Name: "backup.last-failed-time.kms-inaccessible", | ||
Help: "The unix timestamp of the most recent failure of backup due to errKMSInaccessible by a backup specified as maintaining this metric", | ||
Measurement: "Jobs", | ||
Unit: metric.Unit_TIMESTAMP_SEC, | ||
}), | ||
} | ||
return m | ||
} | ||
|
||
func init() { | ||
jobs.MakeBackupMetricsHook = MakeBackupMetrics | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.