mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Add objectives to Summaries
With the next release of client_golang, Summaries will not have objectives by default. To not lose the objectives we have right now, explicitly state the current default objectives. Signed-off-by: beorn7 <beorn@grafana.com>
This commit is contained in:
parent
a000cec011
commit
dd81912554
|
@ -75,9 +75,10 @@ var (
|
||||||
})
|
})
|
||||||
rpcDuration = prometheus.NewSummaryVec(
|
rpcDuration = prometheus.NewSummaryVec(
|
||||||
prometheus.SummaryOpts{
|
prometheus.SummaryOpts{
|
||||||
Namespace: namespace,
|
Namespace: namespace,
|
||||||
Name: "sd_consul_rpc_duration_seconds",
|
Name: "sd_consul_rpc_duration_seconds",
|
||||||
Help: "The duration of a Consul RPC call in seconds.",
|
Help: "The duration of a Consul RPC call in seconds.",
|
||||||
|
Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001},
|
||||||
},
|
},
|
||||||
[]string{"endpoint", "call"},
|
[]string{"endpoint", "call"},
|
||||||
)
|
)
|
||||||
|
|
|
@ -135,8 +135,9 @@ func NewTimestampCollector() *TimestampCollector {
|
||||||
var (
|
var (
|
||||||
fileSDScanDuration = prometheus.NewSummary(
|
fileSDScanDuration = prometheus.NewSummary(
|
||||||
prometheus.SummaryOpts{
|
prometheus.SummaryOpts{
|
||||||
Name: "prometheus_sd_file_scan_duration_seconds",
|
Name: "prometheus_sd_file_scan_duration_seconds",
|
||||||
Help: "The duration of the File-SD scan in seconds.",
|
Help: "The duration of the File-SD scan in seconds.",
|
||||||
|
Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001},
|
||||||
})
|
})
|
||||||
fileSDReadErrorsCount = prometheus.NewCounter(
|
fileSDReadErrorsCount = prometheus.NewCounter(
|
||||||
prometheus.CounterOpts{
|
prometheus.CounterOpts{
|
||||||
|
|
|
@ -34,8 +34,9 @@ var (
|
||||||
)
|
)
|
||||||
duration = prometheus.NewSummaryVec(
|
duration = prometheus.NewSummaryVec(
|
||||||
prometheus.SummaryOpts{
|
prometheus.SummaryOpts{
|
||||||
Name: "prometheus_sd_refresh_duration_seconds",
|
Name: "prometheus_sd_refresh_duration_seconds",
|
||||||
Help: "The duration of a refresh in seconds for the given SD mechanism.",
|
Help: "The duration of a refresh in seconds for the given SD mechanism.",
|
||||||
|
Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001},
|
||||||
},
|
},
|
||||||
[]string{"mechanism"},
|
[]string{"mechanism"},
|
||||||
)
|
)
|
||||||
|
|
|
@ -146,10 +146,11 @@ type alertMetrics struct {
|
||||||
func newAlertMetrics(r prometheus.Registerer, queueCap int, queueLen, alertmanagersDiscovered func() float64) *alertMetrics {
|
func newAlertMetrics(r prometheus.Registerer, queueCap int, queueLen, alertmanagersDiscovered func() float64) *alertMetrics {
|
||||||
m := &alertMetrics{
|
m := &alertMetrics{
|
||||||
latency: prometheus.NewSummaryVec(prometheus.SummaryOpts{
|
latency: prometheus.NewSummaryVec(prometheus.SummaryOpts{
|
||||||
Namespace: namespace,
|
Namespace: namespace,
|
||||||
Subsystem: subsystem,
|
Subsystem: subsystem,
|
||||||
Name: "latency_seconds",
|
Name: "latency_seconds",
|
||||||
Help: "Latency quantiles for sending alert notifications.",
|
Help: "Latency quantiles for sending alert notifications.",
|
||||||
|
Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001},
|
||||||
},
|
},
|
||||||
[]string{alertmanagerLabel},
|
[]string{alertmanagerLabel},
|
||||||
),
|
),
|
||||||
|
|
|
@ -243,6 +243,7 @@ func NewEngine(opts EngineOpts) *Engine {
|
||||||
Name: "query_duration_seconds",
|
Name: "query_duration_seconds",
|
||||||
Help: "Query timings",
|
Help: "Query timings",
|
||||||
ConstLabels: prometheus.Labels{"slice": "queue_time"},
|
ConstLabels: prometheus.Labels{"slice": "queue_time"},
|
||||||
|
Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001},
|
||||||
}),
|
}),
|
||||||
queryPrepareTime: prometheus.NewSummary(prometheus.SummaryOpts{
|
queryPrepareTime: prometheus.NewSummary(prometheus.SummaryOpts{
|
||||||
Namespace: namespace,
|
Namespace: namespace,
|
||||||
|
@ -250,6 +251,7 @@ func NewEngine(opts EngineOpts) *Engine {
|
||||||
Name: "query_duration_seconds",
|
Name: "query_duration_seconds",
|
||||||
Help: "Query timings",
|
Help: "Query timings",
|
||||||
ConstLabels: prometheus.Labels{"slice": "prepare_time"},
|
ConstLabels: prometheus.Labels{"slice": "prepare_time"},
|
||||||
|
Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001},
|
||||||
}),
|
}),
|
||||||
queryInnerEval: prometheus.NewSummary(prometheus.SummaryOpts{
|
queryInnerEval: prometheus.NewSummary(prometheus.SummaryOpts{
|
||||||
Namespace: namespace,
|
Namespace: namespace,
|
||||||
|
@ -257,6 +259,7 @@ func NewEngine(opts EngineOpts) *Engine {
|
||||||
Name: "query_duration_seconds",
|
Name: "query_duration_seconds",
|
||||||
Help: "Query timings",
|
Help: "Query timings",
|
||||||
ConstLabels: prometheus.Labels{"slice": "inner_eval"},
|
ConstLabels: prometheus.Labels{"slice": "inner_eval"},
|
||||||
|
Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001},
|
||||||
}),
|
}),
|
||||||
queryResultSort: prometheus.NewSummary(prometheus.SummaryOpts{
|
queryResultSort: prometheus.NewSummary(prometheus.SummaryOpts{
|
||||||
Namespace: namespace,
|
Namespace: namespace,
|
||||||
|
@ -264,6 +267,7 @@ func NewEngine(opts EngineOpts) *Engine {
|
||||||
Name: "query_duration_seconds",
|
Name: "query_duration_seconds",
|
||||||
Help: "Query timings",
|
Help: "Query timings",
|
||||||
ConstLabels: prometheus.Labels{"slice": "result_sort"},
|
ConstLabels: prometheus.Labels{"slice": "result_sort"},
|
||||||
|
Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001},
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
metrics.maxConcurrentQueries.Set(float64(opts.MaxConcurrent))
|
metrics.maxConcurrentQueries.Set(float64(opts.MaxConcurrent))
|
||||||
|
|
|
@ -79,9 +79,10 @@ func NewGroupMetrics(reg prometheus.Registerer) *Metrics {
|
||||||
m := &Metrics{
|
m := &Metrics{
|
||||||
evalDuration: prometheus.NewSummary(
|
evalDuration: prometheus.NewSummary(
|
||||||
prometheus.SummaryOpts{
|
prometheus.SummaryOpts{
|
||||||
Namespace: namespace,
|
Namespace: namespace,
|
||||||
Name: "rule_evaluation_duration_seconds",
|
Name: "rule_evaluation_duration_seconds",
|
||||||
Help: "The duration for a rule to execute.",
|
Help: "The duration for a rule to execute.",
|
||||||
|
Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001},
|
||||||
}),
|
}),
|
||||||
evalFailures: prometheus.NewCounter(
|
evalFailures: prometheus.NewCounter(
|
||||||
prometheus.CounterOpts{
|
prometheus.CounterOpts{
|
||||||
|
|
Loading…
Reference in a new issue