Skip to content

Commit d1ab530

Browse files
Merge commit '5fdec3140188808bb9c2bf48e94b8533dbf75ac5' into julienduchesne/upstream-pt-3
2 parents 236cc08 + 5fdec31 commit d1ab530

40 files changed

+1687
-623
lines changed

CHANGELOG.md

+49-5
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,53 @@
22

33
## unreleased
44

5-
* [CHANGE] Notifier: Increment the prometheus_notifications_errors_total metric by the number of affected alerts rather than by one per batch of affected alerts. #15428
6-
* [ENHANCEMENT] OTLP receiver: Convert also metric metadata. #15416
7-
* [BUGFIX] OTLP receiver: Allow colons in non-standard units. #15710
5+
## 3.1.0 / 2025-01-02
6+
7+
* [SECURITY] upgrade golang.org/x/crypto to address reported CVE-2024-45337. #15691
8+
* [CHANGE] Notifier: Increment prometheus_notifications_errors_total by the number of affected alerts rather than per batch. #15428
9+
* [CHANGE] API: list rules field "groupNextToken:omitempty" renamed to "groupNextToken". #15400
10+
* [ENHANCEMENT] OTLP translate: keep identifying attributes in target_info. #15448
11+
* [ENHANCEMENT] Paginate rule groups, add infinite scroll to rules within groups. #15677
12+
* [ENHANCEMENT] TSDB: Improve calculation of space used by labels. #13880
13+
* [ENHANCEMENT] Rules: new metric rule_group_last_rule_duration_sum_seconds. #15672
14+
* [ENHANCEMENT] Observability: Export 'go_sync_mutex_wait_total_seconds_total' metric. #15339
15+
* [ENHANCEMEN] Remote-Write: optionally use a DNS resolver that picks a random IP. #15329
16+
* [PERF] Optimize `l=~".+"` matcher. #15474, #15684
17+
* [PERF] TSDB: Cache all symbols for compaction . #15455
18+
* [PERF] TSDB: MemPostings: keep a map of label values slices. #15426
19+
* [PERF] Remote-Write: Remove interning hook. #15456
20+
* [PERF] Scrape: optimize string manipulation for experimental native histograms with custom buckets. #15453
21+
* [PERF] TSDB: reduce memory allocations. #15465, #15427
22+
* [PERF] Storage: Implement limit in mergeGenericQuerier. #14489
23+
* [PERF] TSDB: Optimize inverse matching. #14144
24+
* [PERF] Regex: use stack memory for lowercase copy of string. #15210
25+
* [PERF] TSDB: When deleting from postings index, pause to unlock and let readers read. #15242
26+
* [BUGFIX] Main: Avoid possible segfault at exit. (#15724)
27+
* [BUGFIX] Rules: Do not run rules concurrently if uncertain about dependencies. #15560
28+
* [BUGFIX] PromQL: Adds test for `absent`, `absent_over_time` and `deriv` func with histograms. #15667
29+
* [BUGFIX] PromQL: Fix various bugs related to quoting UTF-8 characters. #15531
30+
* [BUGFIX] Scrape: fix nil panic after scrape loop reload. #15563
31+
* [BUGFIX] Remote-write: fix panic on repeated log message. #15562
32+
* [BUGFIX] Scrape: reload would ignore always_scrape_classic_histograms and convert_classic_histograms_to_nhcb configs. #15489
33+
* [BUGFIX] TSDB: fix data corruption in experimental native histograms. #15482
34+
* [BUGFIX] PromQL: Ignore histograms in all time related functions. #15479
35+
* [BUGFIX] OTLP receiver: Convert metric metadata. #15416
36+
* [BUGFIX] PromQL: Fix `resets` function for histograms. #15527
37+
* [BUGFIX] PromQL: Fix behaviour of `changes()` for mix of histograms and floats. #15469
38+
* [BUGFIX] PromQL: Fix behaviour of some aggregations with histograms. #15432
39+
* [BUGFIX] allow quoted exemplar keys in openmetrics text format. #15260
40+
* [BUGFIX] TSDB: fixes for rare conditions when loading write-behind-log (WBL). #15380
41+
* [BUGFIX] `round()` function did not remove `__name__` label. #15250
42+
* [BUGFIX] Promtool: analyze block shows metric name with 0 cardinality. #15438
43+
* [BUGFIX] PromQL: Fix `count_values` for histograms. #15422
44+
* [BUGFIX] PromQL: fix issues with comparison binary operations with `bool` modifier and native histograms. #15413
45+
* [BUGFIX] PromQL: fix incorrect "native histogram ignored in aggregation" annotations. #15414
46+
* [BUGFIX] PromQL: Corrects the behaviour of some operator and aggregators with Native Histograms. #15245
47+
* [BUGFIX] TSDB: Always return unknown hint for first sample in non-gauge histogram chunk. #15343
48+
* [BUGFIX] PromQL: Clamp functions: Ignore any points with native histograms. #15169
49+
* [BUGFIX] TSDB: Fix race on stale values in headAppender. #15322
50+
* [BUGFIX] UI: Fix selector / series formatting for empty metric names. #15340
51+
* [BUGFIX] OTLP receiver: Allow colons in non-standard units. #15710
852

953
## 3.0.1 / 2024-11-28
1054

@@ -47,14 +91,14 @@ This release includes new features such as a brand new UI and UTF-8 support enab
4791
* [CHANGE] PromQL: Range selectors and the lookback delta are now left-open, i.e. a sample coinciding with the lower time limit is excluded rather than included. #13904
4892
* [CHANGE] Kubernetes SD: Remove support for `discovery.k8s.io/v1beta1` API version of EndpointSlice. This version is no longer served as of Kubernetes v1.25. #14365
4993
* [CHANGE] Kubernetes SD: Remove support for `networking.k8s.io/v1beta1` API version of Ingress. This version is no longer served as of Kubernetes v1.22. #14365
50-
* [CHANGE] UTF-8: Enable UTF-8 support by default. Prometheus now allows all UTF-8 characters in metric and label names. The corresponding `utf8-name` feature flag has been removed. #14705
94+
* [CHANGE] UTF-8: Enable UTF-8 support by default. Prometheus now allows all UTF-8 characters in metric and label names. The corresponding `utf8-name` feature flag has been removed. #14705, #15258
5195
* [CHANGE] Console: Remove example files for the console feature. Users can continue using the console feature by supplying their own JavaScript and templates. #14807
5296
* [CHANGE] SD: Enable the new service discovery manager by default. This SD manager does not restart unchanged discoveries upon reloading. This makes reloads faster and reduces pressure on service discoveries' sources. The corresponding `new-service-discovery-manager` feature flag has been removed. #14770
5397
* [CHANGE] Agent mode has been promoted to stable. The feature flag `agent` has been removed. To run Prometheus in Agent mode, use the new `--agent` cmdline arg instead. #14747
5498
* [CHANGE] Remove deprecated `remote-write-receiver`,`promql-at-modifier`, and `promql-negative-offset` feature flags. #13456, #14526
5599
* [CHANGE] Remove deprecated `storage.tsdb.allow-overlapping-blocks`, `alertmanager.timeout`, and `storage.tsdb.retention` flags. #14640, #14643
56100
* [FEATURE] OTLP receiver: Ability to skip UTF-8 normalization using `otlp.translation_strategy = NoUTF8EscapingWithSuffixes` configuration option. #15384
57-
* [FEATURE] Support config reload automatically - feature flag `auto-reload-config`. #14769
101+
* [FEATURE] Support config reload automatically - feature flag `auto-reload-config`. #14769, #15011
58102
* [ENHANCEMENT] Scraping, rules: handle targets reappearing, or rules moving group, when out-of-order is enabled. #14710
59103
* [ENHANCEMENT] Tools: add debug printouts to promtool rules unit testing #15196
60104
* [ENHANCEMENT] Scraping: support Created-Timestamp feature on native histograms. #14694

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Prometheus will now be reachable at <http://localhost:9090/>.
6767

6868
To build Prometheus from source code, You need:
6969

70-
* Go [version 1.17 or greater](https://golang.org/doc/install).
70+
* Go [version 1.22 or greater](https://golang.org/doc/install).
7171
* NodeJS [version 16 or greater](https://nodejs.org/).
7272
* npm [version 7 or greater](https://www.npmjs.com/).
7373

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0.1
1+
3.1.0

docs/configuration/configuration.md

+2
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ global:
5959
[ scrape_interval: <duration> | default = 1m ]
6060

6161
# How long until a scrape request times out.
62+
# It cannot be greater than the scrape interval.
6263
[ scrape_timeout: <duration> | default = 10s ]
6364

6465
# The protocols to negotiate during a scrape with the client.
@@ -221,6 +222,7 @@ job_name: <job_name>
221222
[ scrape_interval: <duration> | default = <global_config.scrape_interval> ]
222223
223224
# Per-scrape timeout when scraping this job.
225+
# It cannot be greater than the scrape interval.
224226
[ scrape_timeout: <duration> | default = <global_config.scrape_timeout> ]
225227
226228
# The protocols to negotiate during a scrape with the client.

docs/configuration/template_reference.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ versions.
6868

6969
| Name | Arguments | Returns | Notes |
7070
| ------------- | ------------- | ------- | ----------- |
71-
| title | string | string | [strings.Title](https://golang.org/pkg/strings/#Title), capitalises first character of each word.|
71+
| title | string | string | [cases.Title](https://pkg.go.dev/golang.org/x/text/cases#Title), capitalises first character of each word.|
7272
| toUpper | string | string | [strings.ToUpper](https://golang.org/pkg/strings/#ToUpper), converts all characters to upper case.|
7373
| toLower | string | string | [strings.ToLower](https://golang.org/pkg/strings/#ToLower), converts all characters to lower case.|
7474
| stripPort | string | string | [net.SplitHostPort](https://pkg.go.dev/net#SplitHostPort), splits string into host and port, then returns only host.|

model/textparse/nhcbparse.go

+46-44
Original file line numberDiff line numberDiff line change
@@ -177,61 +177,63 @@ func (p *NHCBParser) CreatedTimestamp() *int64 {
177177
}
178178

179179
func (p *NHCBParser) Next() (Entry, error) {
180-
if p.state == stateEmitting {
181-
p.state = stateStart
182-
if p.entry == EntrySeries {
183-
isNHCB := p.handleClassicHistogramSeries(p.lset)
184-
if isNHCB && !p.keepClassicHistograms {
185-
// Do not return the classic histogram series if it was converted to NHCB and we are not keeping classic histograms.
186-
return p.Next()
180+
for {
181+
if p.state == stateEmitting {
182+
p.state = stateStart
183+
if p.entry == EntrySeries {
184+
isNHCB := p.handleClassicHistogramSeries(p.lset)
185+
if isNHCB && !p.keepClassicHistograms {
186+
// Do not return the classic histogram series if it was converted to NHCB and we are not keeping classic histograms.
187+
continue
188+
}
187189
}
190+
return p.entry, p.err
188191
}
189-
return p.entry, p.err
190-
}
191192

192-
p.entry, p.err = p.parser.Next()
193-
if p.err != nil {
194-
if errors.Is(p.err, io.EOF) && p.processNHCB() {
195-
return EntryHistogram, nil
196-
}
197-
return EntryInvalid, p.err
198-
}
199-
switch p.entry {
200-
case EntrySeries:
201-
p.bytes, p.ts, p.value = p.parser.Series()
202-
p.metricString = p.parser.Metric(&p.lset)
203-
// Check the label set to see if we can continue or need to emit the NHCB.
204-
var isNHCB bool
205-
if p.compareLabels() {
206-
// Labels differ. Check if we can emit the NHCB.
207-
if p.processNHCB() {
193+
p.entry, p.err = p.parser.Next()
194+
if p.err != nil {
195+
if errors.Is(p.err, io.EOF) && p.processNHCB() {
208196
return EntryHistogram, nil
209197
}
210-
isNHCB = p.handleClassicHistogramSeries(p.lset)
211-
} else {
212-
// Labels are the same. Check if after an exponential histogram.
213-
if p.lastHistogramExponential {
214-
isNHCB = false
215-
} else {
198+
return EntryInvalid, p.err
199+
}
200+
switch p.entry {
201+
case EntrySeries:
202+
p.bytes, p.ts, p.value = p.parser.Series()
203+
p.metricString = p.parser.Metric(&p.lset)
204+
// Check the label set to see if we can continue or need to emit the NHCB.
205+
var isNHCB bool
206+
if p.compareLabels() {
207+
// Labels differ. Check if we can emit the NHCB.
208+
if p.processNHCB() {
209+
return EntryHistogram, nil
210+
}
216211
isNHCB = p.handleClassicHistogramSeries(p.lset)
212+
} else {
213+
// Labels are the same. Check if after an exponential histogram.
214+
if p.lastHistogramExponential {
215+
isNHCB = false
216+
} else {
217+
isNHCB = p.handleClassicHistogramSeries(p.lset)
218+
}
219+
}
220+
if isNHCB && !p.keepClassicHistograms {
221+
// Do not return the classic histogram series if it was converted to NHCB and we are not keeping classic histograms.
222+
continue
217223
}
224+
return p.entry, p.err
225+
case EntryHistogram:
226+
p.bytes, p.ts, p.h, p.fh = p.parser.Histogram()
227+
p.metricString = p.parser.Metric(&p.lset)
228+
p.storeExponentialLabels()
229+
case EntryType:
230+
p.bName, p.typ = p.parser.Type()
218231
}
219-
if isNHCB && !p.keepClassicHistograms {
220-
// Do not return the classic histogram series if it was converted to NHCB and we are not keeping classic histograms.
221-
return p.Next()
232+
if p.processNHCB() {
233+
return EntryHistogram, nil
222234
}
223235
return p.entry, p.err
224-
case EntryHistogram:
225-
p.bytes, p.ts, p.h, p.fh = p.parser.Histogram()
226-
p.metricString = p.parser.Metric(&p.lset)
227-
p.storeExponentialLabels()
228-
case EntryType:
229-
p.bName, p.typ = p.parser.Type()
230-
}
231-
if p.processNHCB() {
232-
return EntryHistogram, nil
233236
}
234-
return p.entry, p.err
235237
}
236238

237239
// Return true if labels have changed and we should emit the NHCB.

storage/remote/otlptranslator/prometheus/helpers_from_stdlib.go

-106
This file was deleted.

0 commit comments

Comments
 (0)