Skip to content

Commit

Permalink
Merge commit '5fdec3140188808bb9c2bf48e94b8533dbf75ac5' into juliendu…
Browse files Browse the repository at this point in the history
…chesne/upstream-pt-3
  • Loading branch information
julienduchesne committed Jan 8, 2025
2 parents 236cc08 + 5fdec31 commit 62b9e7a
Show file tree
Hide file tree
Showing 38 changed files with 1,678 additions and 614 deletions.
54 changes: 49 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,53 @@

## unreleased

* [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
* [ENHANCEMENT] OTLP receiver: Convert also metric metadata. #15416
* [BUGFIX] OTLP receiver: Allow colons in non-standard units. #15710
## 3.1.0 / 2025-01-02

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

## 3.0.1 / 2024-11-28

Expand Down Expand Up @@ -47,14 +91,14 @@ This release includes new features such as a brand new UI and UTF-8 support enab
* [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
* [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
* [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
* [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
* [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
* [CHANGE] Console: Remove example files for the console feature. Users can continue using the console feature by supplying their own JavaScript and templates. #14807
* [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
* [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
* [CHANGE] Remove deprecated `remote-write-receiver`,`promql-at-modifier`, and `promql-negative-offset` feature flags. #13456, #14526
* [CHANGE] Remove deprecated `storage.tsdb.allow-overlapping-blocks`, `alertmanager.timeout`, and `storage.tsdb.retention` flags. #14640, #14643
* [FEATURE] OTLP receiver: Ability to skip UTF-8 normalization using `otlp.translation_strategy = NoUTF8EscapingWithSuffixes` configuration option. #15384
* [FEATURE] Support config reload automatically - feature flag `auto-reload-config`. #14769
* [FEATURE] Support config reload automatically - feature flag `auto-reload-config`. #14769, #15011
* [ENHANCEMENT] Scraping, rules: handle targets reappearing, or rules moving group, when out-of-order is enabled. #14710
* [ENHANCEMENT] Tools: add debug printouts to promtool rules unit testing #15196
* [ENHANCEMENT] Scraping: support Created-Timestamp feature on native histograms. #14694
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Prometheus will now be reachable at <http://localhost:9090/>.

To build Prometheus from source code, You need:

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

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.1
3.1.0
2 changes: 2 additions & 0 deletions docs/configuration/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ global:
[ scrape_interval: <duration> | default = 1m ]

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

# The protocols to negotiate during a scrape with the client.
Expand Down Expand Up @@ -221,6 +222,7 @@ job_name: <job_name>
[ scrape_interval: <duration> | default = <global_config.scrape_interval> ]
# Per-scrape timeout when scraping this job.
# It cannot be greater than the scrape interval.
[ scrape_timeout: <duration> | default = <global_config.scrape_timeout> ]
# The protocols to negotiate during a scrape with the client.
Expand Down
2 changes: 1 addition & 1 deletion docs/configuration/template_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ versions.

| Name | Arguments | Returns | Notes |
| ------------- | ------------- | ------- | ----------- |
| title | string | string | [strings.Title](https://golang.org/pkg/strings/#Title), capitalises first character of each word.|
| title | string | string | [cases.Title](https://pkg.go.dev/golang.org/x/text/cases#Title), capitalises first character of each word.|
| toUpper | string | string | [strings.ToUpper](https://golang.org/pkg/strings/#ToUpper), converts all characters to upper case.|
| toLower | string | string | [strings.ToLower](https://golang.org/pkg/strings/#ToLower), converts all characters to lower case.|
| stripPort | string | string | [net.SplitHostPort](https://pkg.go.dev/net#SplitHostPort), splits string into host and port, then returns only host.|
Expand Down
90 changes: 46 additions & 44 deletions model/textparse/nhcbparse.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,61 +177,63 @@ func (p *NHCBParser) CreatedTimestamp() *int64 {
}

func (p *NHCBParser) Next() (Entry, error) {
if p.state == stateEmitting {
p.state = stateStart
if p.entry == EntrySeries {
isNHCB := p.handleClassicHistogramSeries(p.lset)
if isNHCB && !p.keepClassicHistograms {
// Do not return the classic histogram series if it was converted to NHCB and we are not keeping classic histograms.
return p.Next()
for {
if p.state == stateEmitting {
p.state = stateStart
if p.entry == EntrySeries {
isNHCB := p.handleClassicHistogramSeries(p.lset)
if isNHCB && !p.keepClassicHistograms {
// Do not return the classic histogram series if it was converted to NHCB and we are not keeping classic histograms.
continue
}
}
return p.entry, p.err
}
return p.entry, p.err
}

p.entry, p.err = p.parser.Next()
if p.err != nil {
if errors.Is(p.err, io.EOF) && p.processNHCB() {
return EntryHistogram, nil
}
return EntryInvalid, p.err
}
switch p.entry {
case EntrySeries:
p.bytes, p.ts, p.value = p.parser.Series()
p.metricString = p.parser.Metric(&p.lset)
// Check the label set to see if we can continue or need to emit the NHCB.
var isNHCB bool
if p.compareLabels() {
// Labels differ. Check if we can emit the NHCB.
if p.processNHCB() {
p.entry, p.err = p.parser.Next()
if p.err != nil {
if errors.Is(p.err, io.EOF) && p.processNHCB() {
return EntryHistogram, nil
}
isNHCB = p.handleClassicHistogramSeries(p.lset)
} else {
// Labels are the same. Check if after an exponential histogram.
if p.lastHistogramExponential {
isNHCB = false
} else {
return EntryInvalid, p.err
}
switch p.entry {
case EntrySeries:
p.bytes, p.ts, p.value = p.parser.Series()
p.metricString = p.parser.Metric(&p.lset)
// Check the label set to see if we can continue or need to emit the NHCB.
var isNHCB bool
if p.compareLabels() {
// Labels differ. Check if we can emit the NHCB.
if p.processNHCB() {
return EntryHistogram, nil
}
isNHCB = p.handleClassicHistogramSeries(p.lset)
} else {
// Labels are the same. Check if after an exponential histogram.
if p.lastHistogramExponential {
isNHCB = false
} else {
isNHCB = p.handleClassicHistogramSeries(p.lset)
}
}
if isNHCB && !p.keepClassicHistograms {
// Do not return the classic histogram series if it was converted to NHCB and we are not keeping classic histograms.
continue
}
return p.entry, p.err
case EntryHistogram:
p.bytes, p.ts, p.h, p.fh = p.parser.Histogram()
p.metricString = p.parser.Metric(&p.lset)
p.storeExponentialLabels()
case EntryType:
p.bName, p.typ = p.parser.Type()
}
if isNHCB && !p.keepClassicHistograms {
// Do not return the classic histogram series if it was converted to NHCB and we are not keeping classic histograms.
return p.Next()
if p.processNHCB() {
return EntryHistogram, nil
}
return p.entry, p.err
case EntryHistogram:
p.bytes, p.ts, p.h, p.fh = p.parser.Histogram()
p.metricString = p.parser.Metric(&p.lset)
p.storeExponentialLabels()
case EntryType:
p.bName, p.typ = p.parser.Type()
}
if p.processNHCB() {
return EntryHistogram, nil
}
return p.entry, p.err
}

// Return true if labels have changed and we should emit the NHCB.
Expand Down
106 changes: 0 additions & 106 deletions storage/remote/otlptranslator/prometheus/helpers_from_stdlib.go

This file was deleted.

Loading

0 comments on commit 62b9e7a

Please sign in to comment.