Skip to content

Commit 0427277

Browse files
authored
Merge branch 'main' into promql-nhcb-use-AM
Signed-off-by: Aman <95525722+amanycodes@users.noreply.github.com>
2 parents aa0a8a9 + a511164 commit 0427277

File tree

25 files changed

+431
-324
lines changed

25 files changed

+431
-324
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
container:
1212
# Whenever the Go version is updated here, .promu.yml
1313
# should also be updated.
14-
image: quay.io/prometheus/golang-builder:1.23-base
14+
image: quay.io/prometheus/golang-builder:1.24-base
1515
steps:
1616
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1717
- uses: prometheus/promci@443c7fc2397e946bc9f5029e313a9c3441b9b86d # v0.4.7
@@ -27,7 +27,7 @@ jobs:
2727
name: More Go tests
2828
runs-on: ubuntu-latest
2929
container:
30-
image: quay.io/prometheus/golang-builder:1.23-base
30+
image: quay.io/prometheus/golang-builder:1.24-base
3131
steps:
3232
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3333
- uses: prometheus/promci@443c7fc2397e946bc9f5029e313a9c3441b9b86d # v0.4.7
@@ -59,7 +59,7 @@ jobs:
5959
# Whenever the Go version is updated here, .promu.yml
6060
# should also be updated.
6161
container:
62-
image: quay.io/prometheus/golang-builder:1.23-base
62+
image: quay.io/prometheus/golang-builder:1.24-base
6363

6464
steps:
6565
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -94,7 +94,7 @@ jobs:
9494
# Whenever the Go version is updated here, .promu.yml
9595
# should also be updated.
9696
container:
97-
image: quay.io/prometheus/golang-builder:1.23-base
97+
image: quay.io/prometheus/golang-builder:1.24-base
9898
steps:
9999
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
100100
- run: go install ./cmd/promtool/.

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ jobs:
2727
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2828

2929
- name: Initialize CodeQL
30-
uses: github/codeql-action/init@5f8171a638ada777af81d42b55959a643bb29017 # v3.28.12
30+
uses: github/codeql-action/init@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13
3131
with:
3232
languages: ${{ matrix.language }}
3333

3434
- name: Autobuild
35-
uses: github/codeql-action/autobuild@5f8171a638ada777af81d42b55959a643bb29017 # v3.28.12
35+
uses: github/codeql-action/autobuild@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13
3636

3737
- name: Perform CodeQL Analysis
38-
uses: github/codeql-action/analyze@5f8171a638ada777af81d42b55959a643bb29017 # v3.28.12
38+
uses: github/codeql-action/analyze@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13

.github/workflows/scorecards.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@ jobs:
4545

4646
# Upload the results to GitHub's code scanning dashboard.
4747
- name: "Upload to code-scanning"
48-
uses: github/codeql-action/upload-sarif@5f8171a638ada777af81d42b55959a643bb29017 # tag=v3.28.12
48+
uses: github/codeql-action/upload-sarif@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # tag=v3.28.13
4949
with:
5050
sarif_file: results.sarif

RELEASE.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ This page describes the release process and the currently planned schedule for u
77
Release cadence of first pre-releases being cut is 6 weeks.
88
Please see [the v2.55 RELEASE.md](https://github.com/prometheus/prometheus/blob/release-2.55/RELEASE.md) for the v2 release series schedule.
99

10-
| release series | date of first pre-release (year-month-day) | release shepherd |
11-
|----------------|--------------------------------------------|-----------------------------------|
12-
| v3.0 | 2024-11-14 | Jan Fajerski (GitHub: @jan--f) |
13-
| v3.1 | 2024-12-17 | Bryan Boreham (GitHub: @bboreham) |
14-
| v3.2 | 2025-01-28 | Jan Fajerski (GitHub: @jan--f) |
15-
| v3.3 | 2025-03-11 | Ayoub Mrini (Github: @machine424) |
16-
| v3.4 | 2025-04-22 | **volunteer welcome** |
10+
| release series | date of first pre-release (year-month-day) | release shepherd |
11+
|----------------|--------------------------------------------|------------------------------------|
12+
| v3.0 | 2024-11-14 | Jan Fajerski (GitHub: @jan--f) |
13+
| v3.1 | 2024-12-17 | Bryan Boreham (GitHub: @bboreham) |
14+
| v3.2 | 2025-01-28 | Jan Fajerski (GitHub: @jan--f) |
15+
| v3.3 | 2025-03-11 | Ayoub Mrini (Github: @machine424) |
16+
| v3.4 | 2025-04-22 | Jan-Otto Kröpke (Github: @jkroepke)|
17+
| v3.5 | 2025-06-03 | **volunteer welcome** |
1718

1819
If you are interested in volunteering please create a pull request against the [prometheus/prometheus](https://github.com/prometheus/prometheus) repository and propose yourself for the release series of your choice.
1920

cmd/promtool/main.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ import (
6161
"github.com/prometheus/prometheus/util/documentcli"
6262
)
6363

64+
var promqlEnableDelayedNameRemoval = false
65+
6466
func init() {
6567
// This can be removed when the legacy global mode is fully deprecated.
6668
//nolint:staticcheck
@@ -304,7 +306,7 @@ func main() {
304306
promQLLabelsDeleteQuery := promQLLabelsDeleteCmd.Arg("query", "PromQL query.").Required().String()
305307
promQLLabelsDeleteName := promQLLabelsDeleteCmd.Arg("name", "Name of the label to delete.").Required().String()
306308

307-
featureList := app.Flag("enable-feature", "Comma separated feature names to enable. Currently unused.").Default("").Strings()
309+
featureList := app.Flag("enable-feature", "Comma separated feature names to enable. Valid options: promql-experimental-functions, promql-delayed-name-removal. See https://prometheus.io/docs/prometheus/latest/feature_flags/ for more details").Default("").Strings()
308310

309311
documentationCmd := app.Command("write-documentation", "Generate command line documentation. Internal use.").Hidden()
310312

@@ -338,10 +340,14 @@ func main() {
338340
opts := strings.Split(f, ",")
339341
for _, o := range opts {
340342
switch o {
343+
case "promql-experimental-functions":
344+
parser.EnableExperimentalFunctions = true
345+
case "promql-delayed-name-removal":
346+
promqlEnableDelayedNameRemoval = true
341347
case "":
342348
continue
343349
default:
344-
fmt.Printf(" WARNING: --enable-feature is currently a no-op")
350+
fmt.Printf(" WARNING: Unknown feature passed to --enable-feature: %s", o)
345351
}
346352
}
347353
}
@@ -399,8 +405,9 @@ func main() {
399405
}
400406
os.Exit(RulesUnitTestResult(results,
401407
promqltest.LazyLoaderOpts{
402-
EnableAtModifier: true,
403-
EnableNegativeOffset: true,
408+
EnableAtModifier: true,
409+
EnableNegativeOffset: true,
410+
EnableDelayedNameRemoval: promqlEnableDelayedNameRemoval,
404411
},
405412
*testRulesRun,
406413
*testRulesDiff,

cmd/promtool/main_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,16 @@ func TestCheckRules(t *testing.T) {
558558
})
559559
}
560560

561+
func TestCheckRulesWithFeatureFlag(t *testing.T) {
562+
// As opposed to TestCheckRules calling CheckRules directly we run promtool
563+
// so the feature flag parsing can be tested.
564+
565+
args := []string{"-test.main", "--enable-feature=promql-experimental-functions", "check", "rules", "testdata/features.yml"}
566+
tool := exec.Command(promtoolPath, args...)
567+
err := tool.Run()
568+
require.NoError(t, err)
569+
}
570+
561571
func TestCheckRulesWithRuleFiles(t *testing.T) {
562572
t.Run("rules-good", func(t *testing.T) {
563573
t.Parallel()

cmd/promtool/testdata/features.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
groups:
2+
- name: features
3+
rules:
4+
- record: x
5+
# We don't expect anything from this, just want to check the function parses.
6+
expr: sort_by_label(up, "instance")

docs/command-line/promtool.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Tooling for the Prometheus monitoring system.
1515
| <code class="text-nowrap">-h</code>, <code class="text-nowrap">--help</code> | Show context-sensitive help (also try --help-long and --help-man). |
1616
| <code class="text-nowrap">--version</code> | Show application version. |
1717
| <code class="text-nowrap">--experimental</code> | Enable experimental commands. |
18-
| <code class="text-nowrap">--enable-feature</code> <code class="text-nowrap">...<code class="text-nowrap"> | Comma separated feature names to enable. Currently unused. |
18+
| <code class="text-nowrap">--enable-feature</code> <code class="text-nowrap">...<code class="text-nowrap"> | Comma separated feature names to enable. Valid options: promql-experimental-functions, promql-delayed-name-removal. See https://prometheus.io/docs/prometheus/latest/feature_flags/ for more details |
1919

2020

2121

documentation/examples/remote_storage/go.mod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ require (
5151
github.com/prometheus/procfs v0.15.1 // indirect
5252
github.com/xhit/go-str2duration/v2 v2.1.0 // indirect
5353
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
54-
go.opentelemetry.io/collector/pdata v1.28.1 // indirect
55-
go.opentelemetry.io/collector/semconv v0.122.1 // indirect
54+
go.opentelemetry.io/collector/pdata v1.30.0 // indirect
55+
go.opentelemetry.io/collector/semconv v0.124.0 // indirect
5656
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0 // indirect
5757
go.opentelemetry.io/otel v1.35.0 // indirect
5858
go.opentelemetry.io/otel/metric v1.35.0 // indirect
@@ -66,8 +66,8 @@ require (
6666
golang.org/x/text v0.23.0 // indirect
6767
golang.org/x/time v0.7.0 // indirect
6868
google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f // indirect
69-
google.golang.org/grpc v1.71.0 // indirect
70-
google.golang.org/protobuf v1.36.5 // indirect
69+
google.golang.org/grpc v1.71.1 // indirect
70+
google.golang.org/protobuf v1.36.6 // indirect
7171
gopkg.in/yaml.v2 v2.4.0 // indirect
7272
gopkg.in/yaml.v3 v3.0.1 // indirect
7373
k8s.io/apimachinery v0.32.3 // indirect

documentation/examples/remote_storage/go.sum

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -318,10 +318,10 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de
318318
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
319319
go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
320320
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
321-
go.opentelemetry.io/collector/pdata v1.28.1 h1:ORl5WLpQJvjzBVpHu12lqKMdcf/qDBwRXMcUubhybiQ=
322-
go.opentelemetry.io/collector/pdata v1.28.1/go.mod h1:asKE8MD/4SOKz1mCrGdAz4VO2U2HUNg8A6094uK7pq0=
323-
go.opentelemetry.io/collector/semconv v0.122.1 h1:WLzDi3QC4/+LpNMLY90zn5aMDJKyqg/ujW2O4T4sxHg=
324-
go.opentelemetry.io/collector/semconv v0.122.1/go.mod h1:te6VQ4zZJO5Lp8dM2XIhDxDiL45mwX0YAQQWRQ0Qr9U=
321+
go.opentelemetry.io/collector/pdata v1.30.0 h1:j3jyq9um436r6WzWySzexP2nLnFdmL5uVBYAlyr9nDM=
322+
go.opentelemetry.io/collector/pdata v1.30.0/go.mod h1:0Bxu1ktuj4wE7PIASNSvd0SdBscQ1PLtYasymJ13/Cs=
323+
go.opentelemetry.io/collector/semconv v0.124.0 h1:YTdo3UFwNyDQCh9DiSm2rbzAgBuwn/9dNZ0rv454goA=
324+
go.opentelemetry.io/collector/semconv v0.124.0/go.mod h1:te6VQ4zZJO5Lp8dM2XIhDxDiL45mwX0YAQQWRQ0Qr9U=
325325
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0 h1:sbiXRNDSWJOTobXh5HyQKjq6wUC5tNybqjIqDpAY4CU=
326326
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0/go.mod h1:69uWxva0WgAA/4bu2Yy70SLDBwZXuQ6PbBpbsa5iZrQ=
327327
go.opentelemetry.io/otel v1.35.0 h1:xKWKPxrxB6OtMCbmMY021CqC45J+3Onta9MqjhnusiQ=
@@ -423,17 +423,17 @@ google.golang.org/genproto/googleapis/api v0.0.0-20250106144421-5f5ef82da422 h1:
423423
google.golang.org/genproto/googleapis/api v0.0.0-20250106144421-5f5ef82da422/go.mod h1:b6h1vNKhxaSoEI+5jc3PJUCustfli/mRab7295pY7rw=
424424
google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f h1:OxYkA3wjPsZyBylwymxSHa7ViiW1Sml4ToBrncvFehI=
425425
google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f/go.mod h1:+2Yz8+CLJbIfL9z73EW45avw8Lmge3xVElCP9zEKi50=
426-
google.golang.org/grpc v1.71.0 h1:kF77BGdPTQ4/JZWMlb9VpJ5pa25aqvVqogsxNHHdeBg=
427-
google.golang.org/grpc v1.71.0/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec=
426+
google.golang.org/grpc v1.71.1 h1:ffsFWr7ygTUscGPI0KKK6TLrGz0476KUvvsbqWK0rPI=
427+
google.golang.org/grpc v1.71.1/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec=
428428
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
429429
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
430430
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
431431
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
432432
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
433433
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
434434
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
435-
google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM=
436-
google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
435+
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
436+
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
437437
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
438438
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
439439
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

0 commit comments

Comments
 (0)