From 6f937ee032a0b7eab120dfaea60dd45cbf96711c Mon Sep 17 00:00:00 2001 From: Julius Volz Date: Fri, 18 Jan 2013 01:16:22 +0100 Subject: [PATCH] Add preliminary metric docstrings and empty base labels. --- retrieval/instrumentation.go | 8 ++++---- storage/metric/leveldb/instrumentation.go | 2 +- storage/metric/leveldb/mutable.go | 4 ++-- storage/metric/leveldb/reading.go | 20 ++++++++++---------- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/retrieval/instrumentation.go b/retrieval/instrumentation.go index 3513ce18e..df85f570f 100644 --- a/retrieval/instrumentation.go +++ b/retrieval/instrumentation.go @@ -34,8 +34,8 @@ var ( ) func init() { - registry.Register("targets_healthy_total", targetsHealthy) - registry.Register("targets_unhealthy_total", targetsUnhealthy) - registry.Register("targets_healthy_scrape_latency_ms", scrapeLatencyHealthy) - registry.Register("targets_unhealthy_scrape_latency_ms", scrapeLatencyUnhealthy) + registry.Register("targets_healthy_total", "Total number of healthy scrape targets", map[string]string{}, targetsHealthy) + registry.Register("targets_unhealthy_total", "Total number of unhealthy scrape targets", map[string]string{}, targetsUnhealthy) + registry.Register("targets_healthy_scrape_latency_ms", "Scrape latency for healthy targets in milliseconds", map[string]string{}, scrapeLatencyHealthy) + registry.Register("targets_unhealthy_scrape_latency_ms", "Scrape latency for unhealthy targets in milliseconds", map[string]string{}, scrapeLatencyUnhealthy) } diff --git a/storage/metric/leveldb/instrumentation.go b/storage/metric/leveldb/instrumentation.go index df1779b42..cc36a3f0c 100644 --- a/storage/metric/leveldb/instrumentation.go +++ b/storage/metric/leveldb/instrumentation.go @@ -32,5 +32,5 @@ var ( ) func init() { - registry.Register("sample_append_disk_latency_microseconds", appendLatency) + registry.Register("sample_append_disk_latency_microseconds", "Latency for sample appends to disk in microseconds", map[string]string{}, appendLatency) } diff --git a/storage/metric/leveldb/mutable.go b/storage/metric/leveldb/mutable.go index 61ad2495d..13f42c609 100644 --- a/storage/metric/leveldb/mutable.go +++ b/storage/metric/leveldb/mutable.go @@ -30,8 +30,8 @@ var ( ) func init() { - registry.Register("sample_append_success_count_total", appendSuccessCount) - registry.Register("sample_append_failure_count_total", appendFailureCount) + registry.Register("sample_append_success_count_total", "Total successfully appended samples", map[string]string{}, appendSuccessCount) + registry.Register("sample_append_failure_count_total", "Total sample append failures", map[string]string{}, appendFailureCount) } func (l *LevelDBMetricPersistence) setLabelPairFingerprints(labelPair *dto.LabelPair, fingerprints *dto.FingerprintCollection) error { diff --git a/storage/metric/leveldb/reading.go b/storage/metric/leveldb/reading.go index 56549f366..17c4db478 100644 --- a/storage/metric/leveldb/reading.go +++ b/storage/metric/leveldb/reading.go @@ -40,17 +40,17 @@ var ( ) func init() { - registry.Register("get_label_name_fingerprints_success_count_total", getLabelNameFingerprintsSuccessCount) - registry.Register("get_label_name_fingerprints_failure_count_total", getLabelNameFingerprintsFailureCount) + registry.Register("get_label_name_fingerprints_success_count_total", "Successfully fetched label name fingerprints", map[string]string{}, getLabelNameFingerprintsSuccessCount) + registry.Register("get_label_name_fingerprints_failure_count_total", "Failures while fetching label name fingerprints", map[string]string{}, getLabelNameFingerprintsFailureCount) - registry.Register("get_fingerprints_for_label_set_success_count_total", getFingerprintsForLabelSetSuccessCount) - registry.Register("get_fingerprints_for_label_set_failure_count_total", getFingerprintsForLabelSetFailureCount) - registry.Register("get_fingerprints_for_label_name_success_count_total", getFingerprintsForLabelNameSuccessCount) - registry.Register("get_fingerprints_for_label_name_failure_count_total", getFingerprintsForLabelNameFailureCount) - registry.Register("get_metric_for_fingerprint_success_count_total", getMetricForFingerprintSuccessCount) - registry.Register("get_metric_for_fingerprint_failure_count_total", getMetricForFingerprintFailureCount) - registry.Register("get_boundary_values_success_count_total", getBoundaryValuesSuccessCount) - registry.Register("get_boundary_values_failure_count_total", getBoundaryValuesFailureCount) + registry.Register("get_fingerprints_for_label_set_success_count_total", "Successfully fetched label set fingerprints", map[string]string{}, getFingerprintsForLabelSetSuccessCount) + registry.Register("get_fingerprints_for_label_set_failure_count_total", "Failures while fetching label set fingerprints", map[string]string{}, getFingerprintsForLabelSetFailureCount) + registry.Register("get_fingerprints_for_label_name_success_count_total", "Successfully fetched label name fingerprints", map[string]string{}, getFingerprintsForLabelNameSuccessCount) + registry.Register("get_fingerprints_for_label_name_failure_count_total", "Failures while fetching label name fingerprints", map[string]string{}, getFingerprintsForLabelNameFailureCount) + registry.Register("get_metric_for_fingerprint_success_count_total", "Successfully fetched metrics by fingerprint", map[string]string{}, getMetricForFingerprintSuccessCount) + registry.Register("get_metric_for_fingerprint_failure_count_total", "Failures while fetching metrics by fingerprint", map[string]string{}, getMetricForFingerprintFailureCount) + registry.Register("get_boundary_values_success_count_total", "Successfully fetched metric boundary values", map[string]string{}, getBoundaryValuesSuccessCount) + registry.Register("get_boundary_values_failure_count_total", "Failures while fetching boundary values", map[string]string{}, getBoundaryValuesFailureCount) } func extractSampleKey(i iterator) (k *dto.SampleKey, err error) {