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

backupccl: add exportrequest.delay.total metric #67310

Merged
merged 1 commit into from
Jul 9, 2021
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
14 changes: 14 additions & 0 deletions pkg/kv/kvserver/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -1051,6 +1051,14 @@ var (
Unit: metric.Unit_NANOSECONDS,
}

// Export request counter.
metaExportEvalTotalDelay = metric.Metadata{
Name: "exportrequest.delay.total",
Help: "Amount by which evaluation of Export requests was delayed",
Measurement: "Nanoseconds",
Unit: metric.Unit_NANOSECONDS,
}

// Encryption-at-rest metrics.
// TODO(mberhault): metrics for key age, per-key file/bytes counts.
metaEncryptionAlgorithm = metric.Metadata{
Expand Down Expand Up @@ -1282,6 +1290,9 @@ type StoreMetrics struct {
AddSSTableProposalTotalDelay *metric.Counter
AddSSTableProposalEngineDelay *metric.Counter

// Export request stats.
ExportRequestProposalTotalDelay *metric.Counter

// Encryption-at-rest stats.
// EncryptionAlgorithm is an enum representing the cipher in use, so we use a gauge.
EncryptionAlgorithm *metric.Gauge
Expand Down Expand Up @@ -1672,6 +1683,9 @@ func newStoreMetrics(histogramWindow time.Duration) *StoreMetrics {
AddSSTableProposalTotalDelay: metric.NewCounter(metaAddSSTableEvalTotalDelay),
AddSSTableProposalEngineDelay: metric.NewCounter(metaAddSSTableEvalEngineDelay),

// ExportRequest proposal.
ExportRequestProposalTotalDelay: metric.NewCounter(metaExportEvalTotalDelay),

// Encryption-at-rest.
EncryptionAlgorithm: metric.NewGauge(metaEncryptionAlgorithm),

Expand Down
1 change: 1 addition & 0 deletions pkg/kv/kvserver/store_send.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ func (s *Store) maybeThrottleBatch(
}

waited := timeutil.Since(before)
s.metrics.ExportRequestProposalTotalDelay.Inc(waited.Nanoseconds())
if waited > time.Second {
log.Infof(ctx, "Export request was delayed by %v", waited)
}
Expand Down
11 changes: 11 additions & 0 deletions pkg/ts/catalog/chart_catalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -2305,6 +2305,17 @@ var charts = []sectionDescription{
},
},
},
{
Organization: [][]string{{DistributionLayer, "Bulk", "Egress"}},
Charts: []chartDescription{
{
Title: "Export Delays",
Metrics: []string{
"exportrequest.delay.total",
},
},
},
},
{
Organization: [][]string{{StorageLayer, "Storage", "KV"}},
Charts: []chartDescription{
Expand Down