Merge pull request #184 from prometheus/metricprefix

Prefix all metrics with `prometheus_*`
This commit is contained in:
Fabian Reinartz 2017-10-20 13:01:15 +02:00 committed by GitHub
commit 9e999e8b0b
3 changed files with 23 additions and 23 deletions

View file

@ -81,30 +81,30 @@ func newCompactorMetrics(r prometheus.Registerer) *compactorMetrics {
m := &compactorMetrics{} m := &compactorMetrics{}
m.ran = prometheus.NewCounter(prometheus.CounterOpts{ m.ran = prometheus.NewCounter(prometheus.CounterOpts{
Name: "tsdb_compactions_total", Name: "prometheus_tsdb_compactions_total",
Help: "Total number of compactions that were executed for the partition.", Help: "Total number of compactions that were executed for the partition.",
}) })
m.failed = prometheus.NewCounter(prometheus.CounterOpts{ m.failed = prometheus.NewCounter(prometheus.CounterOpts{
Name: "tsdb_compactions_failed_total", Name: "prometheus_tsdb_compactions_failed_total",
Help: "Total number of compactions that failed for the partition.", Help: "Total number of compactions that failed for the partition.",
}) })
m.duration = prometheus.NewHistogram(prometheus.HistogramOpts{ m.duration = prometheus.NewHistogram(prometheus.HistogramOpts{
Name: "tsdb_compaction_duration", Name: "prometheus_tsdb_compaction_duration",
Help: "Duration of compaction runs.", Help: "Duration of compaction runs.",
Buckets: prometheus.ExponentialBuckets(1, 2, 10), Buckets: prometheus.ExponentialBuckets(1, 2, 10),
}) })
m.chunkSize = prometheus.NewHistogram(prometheus.HistogramOpts{ m.chunkSize = prometheus.NewHistogram(prometheus.HistogramOpts{
Name: "tsdb_compaction_chunk_size", Name: "prometheus_tsdb_compaction_chunk_size",
Help: "Final size of chunks on their first compaction", Help: "Final size of chunks on their first compaction",
Buckets: prometheus.ExponentialBuckets(32, 1.5, 12), Buckets: prometheus.ExponentialBuckets(32, 1.5, 12),
}) })
m.chunkSamples = prometheus.NewHistogram(prometheus.HistogramOpts{ m.chunkSamples = prometheus.NewHistogram(prometheus.HistogramOpts{
Name: "tsdb_compaction_chunk_samples", Name: "prometheus_tsdb_compaction_chunk_samples",
Help: "Final number of samples on their first compaction", Help: "Final number of samples on their first compaction",
Buckets: prometheus.ExponentialBuckets(4, 1.5, 12), Buckets: prometheus.ExponentialBuckets(4, 1.5, 12),
}) })
m.chunkRange = prometheus.NewHistogram(prometheus.HistogramOpts{ m.chunkRange = prometheus.NewHistogram(prometheus.HistogramOpts{
Name: "tsdb_compaction_chunk_range", Name: "prometheus_tsdb_compaction_chunk_range",
Help: "Final time range of chunks on their first compaction", Help: "Final time range of chunks on their first compaction",
Buckets: prometheus.ExponentialBuckets(100, 4, 10), Buckets: prometheus.ExponentialBuckets(100, 4, 10),
}) })

8
db.go
View file

@ -129,7 +129,7 @@ func newDBMetrics(db *DB, r prometheus.Registerer) *dbMetrics {
m := &dbMetrics{} m := &dbMetrics{}
m.loadedBlocks = prometheus.NewGaugeFunc(prometheus.GaugeOpts{ m.loadedBlocks = prometheus.NewGaugeFunc(prometheus.GaugeOpts{
Name: "tsdb_blocks_loaded", Name: "prometheus_tsdb_blocks_loaded",
Help: "Number of currently loaded data blocks", Help: "Number of currently loaded data blocks",
}, func() float64 { }, func() float64 {
db.mtx.RLock() db.mtx.RLock()
@ -137,15 +137,15 @@ func newDBMetrics(db *DB, r prometheus.Registerer) *dbMetrics {
return float64(len(db.blocks)) return float64(len(db.blocks))
}) })
m.reloads = prometheus.NewCounter(prometheus.CounterOpts{ m.reloads = prometheus.NewCounter(prometheus.CounterOpts{
Name: "tsdb_reloads_total", Name: "prometheus_tsdb_reloads_total",
Help: "Number of times the database reloaded block data from disk.", Help: "Number of times the database reloaded block data from disk.",
}) })
m.reloadsFailed = prometheus.NewCounter(prometheus.CounterOpts{ m.reloadsFailed = prometheus.NewCounter(prometheus.CounterOpts{
Name: "tsdb_reloads_failures_total", Name: "prometheus_tsdb_reloads_failures_total",
Help: "Number of times the database failed to reload black data from disk.", Help: "Number of times the database failed to reload black data from disk.",
}) })
m.compactionsTriggered = prometheus.NewCounter(prometheus.CounterOpts{ m.compactionsTriggered = prometheus.NewCounter(prometheus.CounterOpts{
Name: "tsdb_compactions_triggered_total", Name: "prometheus_tsdb_compactions_triggered_total",
Help: "Total number of triggered compactions for the partition.", Help: "Total number of triggered compactions for the partition.",
}) })

26
head.go
View file

@ -89,59 +89,59 @@ func newHeadMetrics(h *Head, r prometheus.Registerer) *headMetrics {
m := &headMetrics{} m := &headMetrics{}
m.activeAppenders = prometheus.NewGauge(prometheus.GaugeOpts{ m.activeAppenders = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "tsdb_head_active_appenders", Name: "prometheus_tsdb_head_active_appenders",
Help: "Number of currently active appender transactions", Help: "Number of currently active appender transactions",
}) })
m.series = prometheus.NewGauge(prometheus.GaugeOpts{ m.series = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "tsdb_head_series", Name: "prometheus_tsdb_head_series",
Help: "Total number of series in the head block.", Help: "Total number of series in the head block.",
}) })
m.seriesCreated = prometheus.NewGauge(prometheus.GaugeOpts{ m.seriesCreated = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "tsdb_head_series_created_total", Name: "prometheus_tsdb_head_series_created_total",
Help: "Total number of series created in the head", Help: "Total number of series created in the head",
}) })
m.seriesRemoved = prometheus.NewGauge(prometheus.GaugeOpts{ m.seriesRemoved = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "tsdb_head_series_removed_total", Name: "prometheus_tsdb_head_series_removed_total",
Help: "Total number of series removed in the head", Help: "Total number of series removed in the head",
}) })
m.seriesNotFound = prometheus.NewCounter(prometheus.CounterOpts{ m.seriesNotFound = prometheus.NewCounter(prometheus.CounterOpts{
Name: "tsdb_head_series_not_found", Name: "prometheus_tsdb_head_series_not_found",
Help: "Total number of requests for series that were not found.", Help: "Total number of requests for series that were not found.",
}) })
m.chunks = prometheus.NewGauge(prometheus.GaugeOpts{ m.chunks = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "tsdb_head_chunks", Name: "prometheus_tsdb_head_chunks",
Help: "Total number of chunks in the head block.", Help: "Total number of chunks in the head block.",
}) })
m.chunksCreated = prometheus.NewGauge(prometheus.GaugeOpts{ m.chunksCreated = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "tsdb_head_chunks_created_total", Name: "prometheus_tsdb_head_chunks_created_total",
Help: "Total number of chunks created in the head", Help: "Total number of chunks created in the head",
}) })
m.chunksRemoved = prometheus.NewGauge(prometheus.GaugeOpts{ m.chunksRemoved = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "tsdb_head_chunks_removed_total", Name: "prometheus_tsdb_head_chunks_removed_total",
Help: "Total number of chunks removed in the head", Help: "Total number of chunks removed in the head",
}) })
m.gcDuration = prometheus.NewSummary(prometheus.SummaryOpts{ m.gcDuration = prometheus.NewSummary(prometheus.SummaryOpts{
Name: "tsdb_head_gc_duration_seconds", Name: "prometheus_tsdb_head_gc_duration_seconds",
Help: "Runtime of garbage collection in the head block.", Help: "Runtime of garbage collection in the head block.",
}) })
m.maxTime = prometheus.NewGaugeFunc(prometheus.GaugeOpts{ m.maxTime = prometheus.NewGaugeFunc(prometheus.GaugeOpts{
Name: "tsdb_head_max_time", Name: "prometheus_tsdb_head_max_time",
Help: "Maximum timestamp of the head block.", Help: "Maximum timestamp of the head block.",
}, func() float64 { }, func() float64 {
return float64(h.MaxTime()) return float64(h.MaxTime())
}) })
m.minTime = prometheus.NewGaugeFunc(prometheus.GaugeOpts{ m.minTime = prometheus.NewGaugeFunc(prometheus.GaugeOpts{
Name: "tsdb_head_min_time", Name: "prometheus_tsdb_head_min_time",
Help: "Minimum time bound of the head block.", Help: "Minimum time bound of the head block.",
}, func() float64 { }, func() float64 {
return float64(h.MinTime()) return float64(h.MinTime())
}) })
m.walTruncateDuration = prometheus.NewSummary(prometheus.SummaryOpts{ m.walTruncateDuration = prometheus.NewSummary(prometheus.SummaryOpts{
Name: "tsdb_wal_truncate_duration_seconds", Name: "prometheus_tsdb_wal_truncate_duration_seconds",
Help: "Duration of WAL truncation.", Help: "Duration of WAL truncation.",
}) })
m.samplesAppended = prometheus.NewCounter(prometheus.CounterOpts{ m.samplesAppended = prometheus.NewCounter(prometheus.CounterOpts{
Name: "tsdb_head_samples_appended_total", Name: "prometheus_tsdb_head_samples_appended_total",
Help: "Total number of appended sampledb.", Help: "Total number of appended sampledb.",
}) })