Repository: prometheus/prometheus (language: go)

Issue:
Gitpod: Missing Packages in `GOROOT` during Build
### What did you do?

#### Description

I am encountering issues while trying to build the Prometheus project in Gitpod following [CONTRIBUTING.md](https://github.com/prometheus/prometheus/blob/main/CONTRIBUTING.md#steps-to-contribute) guidelines. The build process fails with errors indicating that certain packages are not found in the `GOROOT`. Below are the specific error messages:

```shell
../go/pkg/mod/go.opentelemetry.io/otel@v1.25.0/attribute/set.go:7:2: package cmp is not in GOROOT (/home/gitpod/go/src/cmp)
../go/pkg/mod/github.com/!kim!machine!gun/automemlimit@v0.6.0/memlimit/logger.go:5:2: package log/slog is not in GOROOT (/home/gitpod/go/src/log/slog)
../go/pkg/mod/github.com/hashicorp/nomad/api@v0.0.0-20240418183417-ea5f2f6748c7/consul.go:7:2: package maps is not in GOROOT (/home/gitpod/go/src/maps)
model/labels/labels_common.go:19:2: package slices is not in GOROOT (/home/gitpod/go/src/slices)
```

#### Environment Details

- **Gitpod Dockerfile**:
https://github.com/prometheus/prometheus/blob/52f68a96a45b1c60eda9986656f332472babd047/.gitpod.Dockerfile#L1-L14


- **Gitpod YAML Configuration**:
https://github.com/prometheus/prometheus/blob/52f68a96a45b1c60eda9986656f332472babd047/.gitpod.yml#L1-L20

#### Steps to Reproduce

1. Open the project in Gitpod.
2. Ensure the Gitpod Dockerfile and `.gitpod.yml` are configured as above (the same in master branch).
3. Attempt to build the project using the tasks defined in the Gitpod YAML configuration.

#### Actual Behavior

The build fails with errors indicating that certain packages (`cmp`, `log/slog`, `maps`, `slices`) are not found in `GOROOT`.

### What did you expect to see?

The build should complete successfully without missing package errors.

### What did you see instead? Under which circumstances?

#### Proposed Solution

I propose updating the Go version in the Gitpod docker file to a version that includes the missing packages, such as the latest Go version (Go 1.22.3). This should resolve the missing package errors during the build process.

#### Willing to Submit a PR

I am willing to submit a PR with the following changes:
- Update the `Dockerfile` to use the latest go version 1.22.3.

After updating the custom go version in the Gitpod docker file to 1.22.3. it works as expected and there are no mission packages errors:
```shell
gitpod /workspace/prometheus (test) $  HISTFILE=/workspace/.gitpod/cmd-0 history -r; {
> make build
> } && {
> gp sync-done build
> ./prometheus --config.file=documentation/examples/prometheus.yml
> 
> }
cd web/ui && npm install
(⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠼ reify: timing arborist:cto(⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠴ idealTree: sill logfile do(#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠏ idealTree: timing idealTre(#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠏ idealTree: timing idealTre(#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠏ idealTree: timing idealTre(#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠏ idealTree: timing idealTre(#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠴ reify:fsevents: sill reify(#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠴ reify:fsevents: sill reify(#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠴ reify:fsevents: sill reify(#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠴ reify:fsevents: sill reify(#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠦ reify:@prometheus-io/lezer(#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠇ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠇ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠇ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠇ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠏ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠏ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠏ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠏ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠸ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠴ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠧ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠦ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠸ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠴ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠦ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠇ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠦ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠼ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠧ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠧ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠹ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠙ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠙ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠇ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠙ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠸ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠹ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠴ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠧ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠙ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠴ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠇ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠦ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠧ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠧ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠦ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠴ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠇ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠸ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠴ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠙ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠧ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠙ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠇ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠸ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠦ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠏ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠇ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠦ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠹ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠇ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠹ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠧ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠇ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠏ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠏ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠏ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠏ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠋ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠧ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠋ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠸ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠇ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠹ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠼ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠼ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠧ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠙ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠸ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠼ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠹ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠸ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠇ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠏ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠋ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠹ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠦ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠏ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠦ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠧ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠙ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠦ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠋ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠋ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠸ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠴ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠏ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠴ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠏ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠧ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠼ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠹ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠦ reify:@prometheus-io/app: (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠼ reify:@prometheus-io/app: 

added 1605 packages, and audited 1609 packages in 33s

236 packages are looking for funding
  run `npm fund` for details

13 vulnerabilities (6 moderate, 7 high)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
cd web/ui && CI="" npm run build

> prometheus-io@0.52.0-rc.1 build
> GENERATE_SOURCEMAP=false bash build_ui.sh --all

build lezer-promql

> @prometheus-io/lezer-promql@0.52.0-rc.1 build
> bash ./build.sh

+ npx lezer-generator src/promql.grammar -o src/parser
Wrote src/parser.js and src/parser.terms.js
+ cat src/parser.terms.js
+ bash ./generate-types.sh
+ mkdir -p ./dist
+ indexFile=./dist/index.d.ts
+ [[ -f ./dist/index.d.ts ]]
+ cat
++ sed -E 's/ = [0-9]+/: number/' src/parser.terms.js
+ rollup -c

./src/parser.js → ./dist/index.cjs, ./dist/index.es.js...
created ./dist/index.cjs, ./dist/index.es.js in 59ms
build codemirror-promql

> @prometheus-io/codemirror-promql@0.52.0-rc.1 build
> npm run build:lib


> @prometheus-io/codemirror-promql@0.52.0-rc.1 build:lib
> bash ./build.sh

+ tsc --module esnext --target es2018 --outDir dist/esm
+ tsc --module commonjs --target es5 --outDir dist/cjs --downlevelIteration
build react-app

> @prometheus-io/app@0.52.0-rc.1 build
> react-scripts build

Creating an optimized production build...
Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme
=============

WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.

You may find that it works just fine, or you may not.

SUPPORTED TYPESCRIPT VERSIONS: >=3.3.1 <4.9.0

YOUR TYPESCRIPT VERSION: 4.9.5

Please only submit bug reports when using the officially supported version.

=============
Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme
Compiled with warnings.

[eslint] 
src/pages/graph/SeriesName.tsx
  Line 1:21:  'useContext' is defined but never used  @typescript-eslint/no-unused-vars

src/pages/status/Status.tsx
  Line 130:37:  Expected '!==' and instead saw '!='                                                                                                                                                                                                          eqeqeq
  Line 133:6:   React Hook useEffect has a missing dependency: 'setAnimateLogo'. Either include it or remove the dependency array. If 'setAnimateLogo' changes too often, find the parent component that defines it and wrap that definition in useCallback  react-hooks/exhaustive-deps

Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.

File sizes after gzip:

  489.22 kB  build/static/js/main.b9e603c4.js
  54.21 kB   build/static/css/main.e075b686.css

The project was built assuming it is hosted at ./.
You can control this with the homepage field in your package.json.

The build folder is ready to be deployed.

Find out more about deployment here:

  https://cra.link/deployment

>> bundling npm licenses
rm -f "npm_licenses.tar.bz2" npm_licenses
ln -s . npm_licenses
find npm_licenses/web/ui/node_modules -iname "license*" | tar cfj "npm_licenses.tar.bz2" --files-from=-
rm -f npm_licenses
>> compressing assets
scripts/compress_assets.sh
curl -s -L https://github.com/prometheus/promu/releases/download/v0.17.0/promu-0.17.0.linux-amd64.tar.gz | tar -xvzf - -C /tmp/tmp.GSSumzRFr9
promu-0.17.0.linux-amd64/
promu-0.17.0.linux-amd64/LICENSE
promu-0.17.0.linux-amd64/NOTICE
promu-0.17.0.linux-amd64/promu
mkdir -p /workspace/go/bin
cp /tmp/tmp.GSSumzRFr9/promu-0.17.0.linux-amd64/promu /workspace/go/bin/promu
rm -r /tmp/tmp.GSSumzRFr9
>> building binaries
/workspace/go/bin/promu build --prefix /workspace/prometheus 
 >   prometheus
go: downloading github.com/KimMachineGun/automemlimit v0.6.0
go: downloading github.com/alecthomas/kingpin/v2 v2.4.0
go: downloading github.com/alecthomas/units v0.0.0-20231202071711-9a357b53e9c9
go: downloading github.com/go-kit/log v0.2.1
go: downloading github.com/prometheus/exporter-toolkit v0.11.0
go: downloading github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd
go: downloading github.com/prometheus/common v0.53.0
go: downloading github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f
go: downloading github.com/prometheus/client_golang v1.19.0
go: downloading github.com/oklog/run v1.1.0
go: downloading go.uber.org/atomic v1.11.0
go: downloading go.uber.org/automaxprocs v1.5.3
go: downloading github.com/simonpasquier/klog-gokit v0.3.0
go: downloading github.com/simonpasquier/klog-gokit/v3 v3.3.0
go: downloading github.com/prometheus/common/sigv4 v0.1.0
go: downloading gopkg.in/yaml.v2 v2.4.0
go: downloading k8s.io/client-go v0.29.3
go: downloading github.com/cespare/xxhash/v2 v2.3.0
go: downloading github.com/go-openapi/strfmt v0.23.0
go: downloading github.com/prometheus/alertmanager v0.27.0
go: downloading github.com/edsrzf/mmap-go v1.1.0
go: downloading github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb
go: downloading go.opentelemetry.io/otel v1.25.0
go: downloading go.opentelemetry.io/otel/trace v1.25.0
go: downloading golang.org/x/sync v0.7.0
go: downloading github.com/gogo/protobuf v1.3.2
go: downloading github.com/klauspost/compress v1.17.8
go: downloading github.com/prometheus/client_model v0.6.1
go: downloading github.com/golang/snappy v0.0.4
go: downloading go.opentelemetry.io/collector/pdata v1.5.0
go: downloading go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.50.0
go: downloading go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.25.0
go: downloading go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.25.0
go: downloading go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.25.0
go: downloading go.opentelemetry.io/otel/sdk v1.25.0
go: downloading google.golang.org/grpc v1.63.2
go: downloading github.com/oklog/ulid v1.3.1
go: downloading github.com/go-logfmt/logfmt v0.6.0
go: downloading golang.org/x/time v0.5.0
go: downloading golang.org/x/sys v0.19.0
go: downloading golang.org/x/net v0.24.0
go: downloading github.com/jpillora/backoff v1.0.0
go: downloading github.com/containerd/cgroups/v3 v3.0.3
go: downloading github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58
go: downloading github.com/xhit/go-str2duration/v2 v2.1.0
go: downloading github.com/coreos/go-systemd/v22 v22.5.0
go: downloading golang.org/x/crypto v0.22.0
go: downloading google.golang.org/protobuf v1.34.0
go: downloading golang.org/x/oauth2 v0.19.0
go: downloading github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1
go: downloading github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.2
go: downloading github.com/google/uuid v1.6.0
go: downloading github.com/go-kit/kit v0.12.0
go: downloading github.com/hashicorp/consul/api v1.28.2
go: downloading github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 v5.6.0
go: downloading github.com/aws/aws-sdk-go v1.51.25
go: downloading github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4 v4.3.0
go: downloading github.com/Code-Hex/go-generics-cache v1.5.1
go: downloading github.com/miekg/dns v1.1.59
go: downloading github.com/digitalocean/godo v1.113.0
go: downloading github.com/fsnotify/fsnotify v1.7.0
go: downloading google.golang.org/api v0.177.0
go: downloading github.com/hetznercloud/hcloud-go/v2 v2.7.2
go: downloading github.com/ionos-cloud/sdk-go/v6 v6.1.11
go: downloading github.com/linode/linodego v1.33.0
go: downloading github.com/hashicorp/nomad/api v0.0.0-20240418183417-ea5f2f6748c7
go: downloading k8s.io/api v0.29.3
go: downloading k8s.io/apimachinery v0.29.3
go: downloading github.com/gophercloud/gophercloud v1.11.0
go: downloading github.com/ovh/go-ovh v1.4.3
go: downloading github.com/docker/docker v26.0.1+incompatible
go: downloading github.com/scaleway/scaleway-sdk-go v1.0.0-beta.26
go: downloading github.com/kolo/xmlrpc v0.0.0-20220921171641-a4b6fa1dd06b
go: downloading github.com/vultr/govultr/v2 v2.17.2
go: downloading github.com/go-zookeeper/zk v1.0.3
go: downloading github.com/envoyproxy/go-control-plane v0.12.0
go: downloading github.com/envoyproxy/protoc-gen-validate v1.0.4
go: downloading google.golang.org/genproto/googleapis/api v0.0.0-20240415180920-8c6c420018be
go: downloading github.com/beorn7/perks v1.0.1
go: downloading github.com/prometheus/procfs v0.12.0
go: downloading gopkg.in/yaml.v3 v3.0.1
go: downloading github.com/dennwc/varint v1.0.0
go: downloading go.opentelemetry.io/collector/semconv v0.98.0
go: downloading go.uber.org/multierr v1.11.0
go: downloading github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2
go: downloading github.com/go-openapi/errors v0.22.0
go: downloading github.com/mitchellh/mapstructure v1.5.0
go: downloading go.mongodb.org/mongo-driver v1.14.0
go: downloading github.com/felixge/httpsnoop v1.0.4
go: downloading go.opentelemetry.io/otel/metric v1.25.0
go: downloading github.com/json-iterator/go v1.1.12
go: downloading github.com/go-logr/logr v1.4.1
go: downloading github.com/bboreham/go-loser v0.0.0-20230920113527-fcc2c21820a3
go: downloading github.com/stretchr/testify v1.9.0
go: downloading go.opentelemetry.io/proto/otlp v1.1.0
go: downloading github.com/julienschmidt/httprouter v1.3.0
go: downloading google.golang.org/genproto/googleapis/rpc v0.0.0-20240429193739-8cf5692501f6
go: downloading github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822
go: downloading github.com/prometheus/common/assets v0.2.0
go: downloading github.com/docker/go-units v0.5.0
go: downloading github.com/godbus/dbus/v5 v5.0.4
go: downloading github.com/opencontainers/runtime-spec v1.0.2
go: downloading github.com/cilium/ebpf v0.11.0
go: downloading github.com/sirupsen/logrus v1.9.3
go: downloading github.com/go-openapi/swag v0.22.9
go: downloading github.com/go-openapi/validate v0.23.0
go: downloading github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.2
go: downloading github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2
go: downloading github.com/hashicorp/go-cleanhttp v0.5.2
go: downloading github.com/hashicorp/go-hclog v1.5.0
go: downloading github.com/hashicorp/go-multierror v1.1.1
go: downloading github.com/hashicorp/go-rootcerts v1.0.2
go: downloading github.com/hashicorp/serf v0.10.1
go: downloading golang.org/x/exp v0.0.0-20240119083558-1b970713d09a
go: downloading cloud.google.com/go/compute/metadata v0.3.0
go: downloading github.com/google/go-querystring v1.1.0
go: downloading github.com/hashicorp/go-retryablehttp v0.7.4
go: downloading k8s.io/utils v0.0.0-20230726121419-3b25d923346b
go: downloading github.com/gorilla/websocket v1.5.0
go: downloading github.com/hashicorp/cronexpr v1.1.2
go: downloading github.com/go-resty/resty/v2 v2.12.0
go: downloading golang.org/x/text v0.14.0
go: downloading gopkg.in/ini.v1 v1.67.0
go: downloading github.com/google/gofuzz v1.2.0
go: downloading github.com/imdario/mergo v0.3.16
go: downloading github.com/spf13/pflag v1.0.5
go: downloading golang.org/x/term v0.19.0
go: downloading github.com/google/go-cmp v0.6.0
go: downloading sigs.k8s.io/structured-merge-diff/v4 v4.4.1
go: downloading github.com/docker/go-connections v0.4.0
go: downloading github.com/moby/docker-image-spec v1.3.1
go: downloading github.com/distribution/reference v0.5.0
go: downloading github.com/opencontainers/go-digest v1.0.0
go: downloading github.com/opencontainers/image-spec v1.0.2
go: downloading github.com/pkg/errors v0.9.1
go: downloading github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa
go: downloading github.com/golang/protobuf v1.5.4
go: downloading github.com/go-logr/stdr v1.2.2
go: downloading github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
go: downloading github.com/modern-go/reflect2 v1.0.2
go: downloading github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
go: downloading go.uber.org/goleak v1.3.0
go: downloading github.com/cenkalti/backoff/v4 v4.3.0
go: downloading github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0
go: downloading github.com/mailru/easyjson v0.7.7
go: downloading github.com/kylelemons/godebug v1.1.0
go: downloading github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c
go: downloading github.com/go-openapi/analysis v0.22.2
go: downloading github.com/grpc-ecosystem/grpc-gateway v1.16.0
go: downloading github.com/go-openapi/jsonpointer v0.20.2
go: downloading github.com/go-openapi/loads v0.21.5
go: downloading github.com/go-openapi/spec v0.20.14
go: downloading github.com/fatih/color v1.15.0
go: downloading github.com/mattn/go-isatty v0.0.19
go: downloading github.com/hashicorp/errwrap v1.1.0
go: downloading github.com/armon/go-metrics v0.4.1
go: downloading gopkg.in/inf.v0 v0.9.1
go: downloading github.com/google/gnostic-models v0.6.8
go: downloading sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd
go: downloading github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2
go: downloading github.com/josharian/intern v1.0.0
go: downloading github.com/golang-jwt/jwt/v5 v5.2.1
go: downloading github.com/mattn/go-colorable v0.1.13
go: downloading github.com/go-openapi/jsonreference v0.20.4
go: downloading k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340
go: downloading sigs.k8s.io/yaml v1.3.0
go: downloading github.com/hashicorp/go-immutable-radix v1.3.1
go: downloading github.com/hashicorp/golang-lru v0.6.0
go: downloading github.com/emicklei/go-restful/v3 v3.11.0
go: downloading github.com/jmespath/go-jmespath v0.4.0
go: downloading go.opencensus.io v0.24.0
go: downloading cloud.google.com/go/auth v0.3.0
go: downloading github.com/google/s2a-go v0.1.7
go: downloading cloud.google.com/go/auth/oauth2adapt v0.2.2
go: downloading github.com/googleapis/gax-go/v2 v2.12.3
go: downloading github.com/googleapis/enterprise-certificate-proxy v0.3.2
go: downloading github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da
 >   promtool
go: downloading github.com/nsf/jsondiff v0.0.0-20230430225905-43f6cf3098c1
go: downloading github.com/google/pprof v0.0.0-20240416155748-26353dc0451f
ts=2024-05-19T05:36:54.262Z caller=main.go:574 level=info msg="No time or size retention was set so using the default time retention" duration=15d
ts=2024-05-19T05:36:54.262Z caller=main.go:618 level=info msg="Starting Prometheus Server" mode=server version="(version=2.52.0-rc.1, branch=test, revision=9ce12d49b878424aebc2e120cd5dcfbf04a23852)"
ts=2024-05-19T05:36:54.262Z caller=main.go:623 level=info build_context="(go=go1.22.2, platform=linux/amd64, user=gitpod@mohamedawnal-prometheus-flhv2fqx1x8, date=20240519-05:35:02, tags=netgo,builtinassets,stringlabels)"
ts=2024-05-19T05:36:54.262Z caller=main.go:624 level=info host_details="(Linux 6.1.75-060175-generic #202402010024 SMP PREEMPT_DYNAMIC Thu Feb  1 01:44:23 UTC 2024 x86_64 mohamedawnal-prometheus-flhv2fqx1x8 (none))"
ts=2024-05-19T05:36:54.262Z caller=main.go:625 level=info fd_limits="(soft=1048576, hard=1048576)"
ts=2024-05-19T05:36:54.262Z caller=main.go:626 level=info vm_limits="(soft=unlimited, hard=unlimited)"
ts=2024-05-19T05:36:54.265Z caller=web.go:568 level=info component=web msg="Start listening for connections" address=0.0.0.0:9090
ts=2024-05-19T05:36:54.266Z caller=main.go:1130 level=info msg="Starting TSDB ..."
ts=2024-05-19T05:36:54.267Z caller=tls_config.go:313 level=info component=web msg="Listening on" address=[::]:9090
ts=2024-05-19T05:36:54.267Z caller=tls_config.go:316 level=info component=web msg="TLS is disabled." http2=false address=[::]:9090
ts=2024-05-19T05:36:54.269Z caller=head.go:616 level=info component=tsdb msg="Replaying on-disk memory mappable chunks if any"
ts=2024-05-19T05:36:54.269Z caller=head.go:703 level=info component=tsdb msg="On-disk memory mappable chunks replay completed" duration=1.13µs
ts=2024-05-19T05:36:54.269Z caller=head.go:711 level=info component=tsdb msg="Replaying WAL, this may take a while"
ts=2024-05-19T05:36:54.270Z caller=head.go:783 level=info component=tsdb msg="WAL segment loaded" segment=0 maxSegment=0
ts=2024-05-19T05:36:54.270Z caller=head.go:820 level=info component=tsdb msg="WAL replay completed" checkpoint_replay_duration=27.44µs wal_replay_duration=1.5294ms wbl_replay_duration=190ns chunk_snapshot_load_duration=0s mmap_chunk_replay_duration=1.13µs total_replay_duration=1.59951ms
ts=2024-05-19T05:36:54.273Z caller=main.go:1151 level=info fs_type=XFS_SUPER_MAGIC
ts=2024-05-19T05:36:54.273Z caller=main.go:1154 level=info msg="TSDB started"
ts=2024-05-19T05:36:54.273Z caller=main.go:1336 level=info msg="Loading configuration file" filename=documentation/examples/prometheus.yml
ts=2024-05-19T05:36:54.274Z caller=main.go:1373 level=info msg="Completed loading of configuration file" filename=documentation/examples/prometheus.yml totalDuration=619.44µs db_storage=950ns remote_storage=1.52µs web_handler=290ns query_engine=810ns scrape=345.4µs scrape_sd=29.06µs notify=16.76µs notify_sd=6.95µs rules=1.18µs tracing=4.93µs
ts=2024-05-19T05:36:54.274Z caller=main.go:1115 level=info msg="Server is ready to receive web requests."
ts=2024-05-19T05:36:54.274Z caller=manager.go:163 level=info component="rule manager" msg="Starting rule manager..."
```

#### Additional Testing

After updating the Go version to 1.22.3, I ran the test cases to ensure there were no regressions. All tests passed except for one:

- `TestAsyncRuleEvaluation/asynchronous_evaluation_of_all_independent_rules,_insufficient_concurrency`

This failure is likely due to the limited computational resources allocated in the Gitpod workspace, rather than the Go version update.

```
gitpod /workspace/prometheus (test) $ make test
>> cleaning generated parser
>> running goyacc to generate the .go file.

conflicts: 19 shift/reduce
>> checking generated parser
>> running all tests
go test -race  ./...
go: downloading github.com/stretchr/objx v0.5.2
go: downloading github.com/evanphx/json-patch v5.6.0+incompatible
?       github.com/prometheus/prometheus/discovery/aws  [no test files]
?       github.com/prometheus/prometheus/discovery/gce  [no test files]
?       github.com/prometheus/prometheus/discovery/install      [no test files]
ok      github.com/prometheus/prometheus/cmd/prometheus 109.313s
ok      github.com/prometheus/prometheus/cmd/promtool   27.829s
ok      github.com/prometheus/prometheus/config 1.195s
ok      github.com/prometheus/prometheus/discovery      5.626s
ok      github.com/prometheus/prometheus/discovery/azure        1.018s
ok      github.com/prometheus/prometheus/discovery/consul       4.031s
ok      github.com/prometheus/prometheus/discovery/digitalocean 1.020s
ok      github.com/prometheus/prometheus/discovery/dns  1.019s
ok      github.com/prometheus/prometheus/discovery/eureka       1.030s
ok      github.com/prometheus/prometheus/discovery/file 3.336s
ok      github.com/prometheus/prometheus/discovery/hetzner      1.027s
ok      github.com/prometheus/prometheus/discovery/http 1.040s
ok      github.com/prometheus/prometheus/discovery/ionos        1.024s
ok      github.com/prometheus/prometheus/discovery/kubernetes   34.654s
ok      github.com/prometheus/prometheus/discovery/legacymanager        4.225s
ok      github.com/prometheus/prometheus/discovery/linode       1.030s
ok      github.com/prometheus/prometheus/discovery/marathon     1.021s
ok      github.com/prometheus/prometheus/discovery/moby 1.114s
ok      github.com/prometheus/prometheus/discovery/nomad        1.018s
ok      github.com/prometheus/prometheus/discovery/openstack    1.045s
ok      github.com/prometheus/prometheus/discovery/ovhcloud     1.028s
ok      github.com/prometheus/prometheus/discovery/puppetdb     1.035s
ok      github.com/prometheus/prometheus/discovery/refresh      1.018s
ok      github.com/prometheus/prometheus/discovery/scaleway     1.028s
ok      github.com/prometheus/prometheus/discovery/targetgroup  1.013s
ok      github.com/prometheus/prometheus/discovery/triton       1.081s
ok      github.com/prometheus/prometheus/discovery/uyuni        1.022s
ok      github.com/prometheus/prometheus/discovery/vultr        1.019s
ok      github.com/prometheus/prometheus/discovery/xds  3.093s
ok      github.com/prometheus/prometheus/discovery/zookeeper    1.032s
?       github.com/prometheus/prometheus/documentation/examples/custom-sd/adapter-usage [no test files]
?       github.com/prometheus/prometheus/model/exemplar [no test files]
ok      github.com/prometheus/prometheus/documentation/examples/custom-sd/adapter       1.015s
?       github.com/prometheus/prometheus/model/metadata [no test files]
ok      github.com/prometheus/prometheus/model/histogram        1.125s
?       github.com/prometheus/prometheus/model/timestamp        [no test files]
?       github.com/prometheus/prometheus/model/value    [no test files]
?       github.com/prometheus/prometheus/plugins        [no test files]
?       github.com/prometheus/prometheus/prompb [no test files]
?       github.com/prometheus/prometheus/prompb/io/prometheus/client    [no test files]
ok      github.com/prometheus/prometheus/model/labels   4.303s
ok      github.com/prometheus/prometheus/model/relabel  1.097s
ok      github.com/prometheus/prometheus/model/rulefmt  1.112s
ok      github.com/prometheus/prometheus/model/textparse        1.071s
ok      github.com/prometheus/prometheus/notifier       3.459s
?       github.com/prometheus/prometheus/promql/parser/posrange [no test files]
?       github.com/prometheus/prometheus/storage/remote/otlptranslator/prometheus       [no test files]
?       github.com/prometheus/prometheus/tsdb/encoding  [no test files]
?       github.com/prometheus/prometheus/tsdb/errors    [no test files]
?       github.com/prometheus/prometheus/util/almost    [no test files]
?       github.com/prometheus/prometheus/util/annotations       [no test files]
?       github.com/prometheus/prometheus/util/documentcli       [no test files]
?       github.com/prometheus/prometheus/util/gate      [no test files]
?       github.com/prometheus/prometheus/util/jsonutil  [no test files]
?       github.com/prometheus/prometheus/util/osutil    [no test files]
?       github.com/prometheus/prometheus/util/runtime   [no test files]
?       github.com/prometheus/prometheus/util/runutil   [no test files]
?       github.com/prometheus/prometheus/util/teststorage       [no test files]
?       github.com/prometheus/prometheus/util/testutil  [no test files]
?       github.com/prometheus/prometheus/util/treecache [no test files]
?       github.com/prometheus/prometheus/web/ui [no test files]
ok      github.com/prometheus/prometheus/promql 190.077s
ok      github.com/prometheus/prometheus/promql/parser  10.118s
ok      github.com/prometheus/prometheus/promql/promqltest      3.208s
--- FAIL: TestAsyncRuleEvaluation (0.51s)
    --- FAIL: TestAsyncRuleEvaluation/asynchronous_evaluation_of_all_independent_rules,_insufficient_concurrency (0.18s)
        manager_test.go:1963: 
                Error Trace:    /workspace/prometheus/rules/manager_test.go:1963
                Error:          "0.115001058" is not less than "0.09"
                Test:           TestAsyncRuleEvaluation/asynchronous_evaluation_of_all_independent_rules,_insufficient_concurrency
FAIL
FAIL    github.com/prometheus/prometheus/rules  44.393s
ok      github.com/prometheus/prometheus/scrape 33.313s
ok      github.com/prometheus/prometheus/storage        1.377s
ok      github.com/prometheus/prometheus/storage/remote 63.304s
ok      github.com/prometheus/prometheus/storage/remote/azuread 13.043s
ok      github.com/prometheus/prometheus/storage/remote/otlptranslator/prometheusremotewrite    1.015s [no tests to run]
ok      github.com/prometheus/prometheus/template       1.025s
ok      github.com/prometheus/prometheus/tracing        1.098s
ok      github.com/prometheus/prometheus/tsdb   455.795s
ok      github.com/prometheus/prometheus/tsdb/agent     89.362s
ok      github.com/prometheus/prometheus/tsdb/chunkenc  1.093s
ok      github.com/prometheus/prometheus/tsdb/chunks    62.484s
ok      github.com/prometheus/prometheus/tsdb/fileutil  1.080s
ok      github.com/prometheus/prometheus/tsdb/goversion 1.070s
ok      github.com/prometheus/prometheus/tsdb/index     80.498s
ok      github.com/prometheus/prometheus/tsdb/record    1.030s
ok      github.com/prometheus/prometheus/tsdb/tombstones        1.028s
ok      github.com/prometheus/prometheus/tsdb/tsdbutil  1.027s
ok      github.com/prometheus/prometheus/tsdb/wlog      51.784s
ok      github.com/prometheus/prometheus/util/fmtutil   1.096s
ok      github.com/prometheus/prometheus/util/httputil  1.184s
ok      github.com/prometheus/prometheus/util/logging   1.219s
ok      github.com/prometheus/prometheus/util/pool      1.017s
ok      github.com/prometheus/prometheus/util/stats     1.180s
ok      github.com/prometheus/prometheus/util/strutil   1.087s
ok      github.com/prometheus/prometheus/util/zeropool  5.017s
ok      github.com/prometheus/prometheus/web    17.181s
ok      github.com/prometheus/prometheus/web/api/v1     2.206s
FAIL
make: *** [Makefile.common:153: common-test] Error 1
```

Please let me know if this solution is acceptable or if there are any additional considerations.

Thank you!

### System information

_No response_

### Prometheus version

_No response_

### Prometheus configuration file

_No response_

### Alertmanager version

_No response_

### Alertmanager configuration file

_No response_

### Logs

_No response_


Discussion / hints:
Hey @mohamedawnallah, updating the go version in Gitpod Dockerfile sounds like a good solution :)

Even better if somehow we could configure the Dockerfile go version based on the version specified in our [go.mod](https://github.com/prometheus/prometheus/blob/114dc5c393ce54ac663a2466a82571e1e0e0d03d/go.mod#L3), that way the Gitpod workspace would always be up to date!
Thanks so much, @ArthurSens, for the suggestion! I really like it; it's a durable solution. I've just submitted a PR that automatically fetches the Go version from the `go.mod` file and the `goyacc` parser version from the Makefile. I'd love to receive any feedback! 🙏

Fix patch:
diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile
index d645db5de15..2370ec5f5c2 100644
--- a/.gitpod.Dockerfile
+++ b/.gitpod.Dockerfile
@@ -1,15 +1,33 @@
 FROM gitpod/workspace-full
 
+# Set Node.js version as an environment variable.
 ENV CUSTOM_NODE_VERSION=16
-ENV CUSTOM_GO_VERSION=1.19
-ENV GOPATH=$HOME/go-packages
-ENV GOROOT=$HOME/go
-ENV PATH=$GOROOT/bin:$GOPATH/bin:$PATH
 
+# Install and use the specified Node.js version via nvm.
 RUN bash -c ". .nvm/nvm.sh && nvm install ${CUSTOM_NODE_VERSION} && nvm use ${CUSTOM_NODE_VERSION} && nvm alias default ${CUSTOM_NODE_VERSION}"
 
+# Ensure nvm uses the default Node.js version in all new shells.
 RUN echo "nvm use default &>/dev/null" >> ~/.bashrc.d/51-nvm-fix
-RUN curl -fsSL https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz | tar xzs \
-    && printf '%s\n' 'export GOPATH=/workspace/go' \
-                      'export PATH=$GOPATH/bin:$PATH' > $HOME/.bashrc.d/300-go
 
+# Remove any existing Go installation in $HOME path.
+RUN rm -rf $HOME/go $HOME/go-packages
+
+# Export go environment variables.
+RUN echo "export GOPATH=/workspace/go" >> ~/.bashrc.d/300-go && \
+    echo "export GOBIN=\$GOPATH/bin" >> ~/.bashrc.d/300-go && \
+    echo "export GOROOT=${HOME}/go" >> ~/.bashrc.d/300-go && \
+    echo "export PATH=\$GOROOT/bin:\$GOBIN:\$PATH" >> ~/.bashrc
+
+# Reload the environment variables to ensure go environment variables are
+# available in subsequent commands.
+RUN bash -c "source ~/.bashrc && source ~/.bashrc.d/300-go"
+
+# Fetch the Go version dynamically from the Prometheus go.mod file and Install Go in $HOME path.
+RUN export CUSTOM_GO_VERSION=$(curl -sSL "https://raw.githubusercontent.com/prometheus/prometheus/main/go.mod" | awk '/^go/{print $2".0"}') && \
+    curl -fsSL "https://dl.google.com/go/go${CUSTOM_GO_VERSION}.linux-amd64.tar.gz" | \
+    tar -xz -C $HOME
+
+# Fetch the goyacc parser version dynamically from the Prometheus Makefile
+# and install it globally in $GOBIN path.
+RUN GOYACC_VERSION=$(curl -fsSL "https://raw.githubusercontent.com/prometheus/prometheus/main/Makefile" | awk -F'=' '/GOYACC_VERSION \?=/{gsub(/ /, "", $2); print $2}') && \
+    go install "golang.org/x/tools/cmd/goyacc@${GOYACC_VERSION}"


Test patch: