mirror of
https://github.com/prometheus/prometheus.git
synced 2025-08-06 14:17:12 +02:00
Fix small issues and clarify documentation
Signed-off-by: chardch <otwordsne@gmail.com>
This commit is contained in:
parent
2f59d38054
commit
357b5ed640
@ -900,8 +900,8 @@ func (c *ScrapeConfig) Validate(globalConfig GlobalConfig) error {
|
||||
}
|
||||
|
||||
if c.ConvertClassicHistogramsToNHCB == nil {
|
||||
globalVal := &globalConfig.ConvertClassicHistogramsToNHCB
|
||||
c.ConvertClassicHistogramsToNHCB = globalVal
|
||||
global := globalConfig.ConvertClassicHistogramsToNHCB
|
||||
c.ConvertClassicHistogramsToNHCB = &global
|
||||
}
|
||||
|
||||
return nil
|
||||
@ -926,7 +926,7 @@ func ToValidationScheme(s string) (validationScheme model.ValidationScheme, err
|
||||
return validationScheme, nil
|
||||
}
|
||||
|
||||
// ConvertClassicHistogramsToNHCBEnabled returns whether to convert classic histograms to NHCB
|
||||
// ConvertClassicHistogramsToNHCBEnabled returns whether to convert classic histograms to NHCB.
|
||||
func (c *ScrapeConfig) ConvertClassicHistogramsToNHCBEnabled() bool {
|
||||
return c.ConvertClassicHistogramsToNHCB != nil && *c.ConvertClassicHistogramsToNHCB
|
||||
}
|
||||
|
@ -536,10 +536,10 @@ metric_relabel_configs:
|
||||
# schema 8, but might change in the future).
|
||||
[ native_histogram_min_bucket_factor: <float> | default = 0 ]
|
||||
|
||||
# Specifies whether to convert scraped classic histograms from this into
|
||||
# native histogram with custom buckets.
|
||||
[ convert_classic_histograms_to_nhcb <bool> | default = false
|
||||
or global.convert_classic_histograms_to_nhcb if unset]
|
||||
# Specifies whether to convert classic histograms into native histograms with
|
||||
# custom buckets (has no effect without --enable-feature=native-histograms).
|
||||
[ convert_classic_histograms_to_nhcb <bool> | default =
|
||||
<global.convert_classic_histograms_to_nhcb>]
|
||||
```
|
||||
|
||||
Where `<job_name>` must be unique across all scrape configurations.
|
||||
|
@ -523,7 +523,7 @@ func (sp *scrapePool) sync(targets []*Target) {
|
||||
mrc = sp.config.MetricRelabelConfigs
|
||||
fallbackScrapeProtocol = sp.config.ScrapeFallbackProtocol.HeaderMediaType()
|
||||
alwaysScrapeClassicHist = sp.config.AlwaysScrapeClassicHistograms
|
||||
convertClassicHistToNHCB = sp.config.ConvertClassicHistogramsToNHCB != nil && *sp.config.ConvertClassicHistogramsToNHCB
|
||||
convertClassicHistToNHCB = sp.config.ConvertClassicHistogramsToNHCBEnabled()
|
||||
)
|
||||
|
||||
sp.targetMtx.Lock()
|
||||
|
Loading…
Reference in New Issue
Block a user