Bump github.com/prometheus/common from 0.67.5 to 0.68.1#89
Conversation
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.67.5 to 0.68.1. - [Release notes](https://github.com/prometheus/common/releases) - [Changelog](https://github.com/prometheus/common/blob/main/CHANGELOG.md) - [Commits](prometheus/common@v0.67.5...v0.68.1) --- updated-dependencies: - dependency-name: github.com/prometheus/common dependency-version: 0.68.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
|
|
📝 WalkthroughWalkthroughVendor refresh updates dependencies and syncs modules. JWT parsing changes reorder key lookup and add an nbf-required option. Prometheus common adjusts OAuth2/TLS and OpenMetrics unit emission. x/net/http2 is split for Go 1.27 with wrapper/common layers. IDNA gains Unicode-aware validation. x/sys adds vectored I/O, constants, syscall numbers, and Windows NT EA APIs. ChangesModule and vendor index updates
golang-jwt/jwt v5 parsing and validation updates
Prometheus common: HTTP/TLS/OAuth2 and OpenMetrics
x/net/http2 Go 1.27-aware split (client/server/transport/writesched)
x/net/idna Unicode-aware refactor
x/sys/unix: vectored I/O, constants, types, and syscall numbers
x/sys/windows: NT file EA and info APIs
Sequence Diagram(s)sequenceDiagram
rect rgba(200, 230, 255, 0.5)
participant App
participant NetHTTP as net/http.Transport
participant H2T as http2.Transport
participant H2S as http2.Server
end
App->>NetHTTP: RoundTrip(req)
NetHTTP->>H2T: Delegate via registered http/2 protocol
H2T->>H2S: ServeConnFunc/HTTP2Config
H2S-->>App: Response
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
|
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
vendor/golang.org/x/net/http2/transport_wrap.go (1)
29-34: ⚡ Quick winClarify/seed TLS + dial settings for direct use of returned
*http2.Transport
vendor/golang.org/x/net/http2/transport_wrap.go’sconfigureTransportsreturnstr2 := &Transport{}without copying*http.TransportTLS/dial configuration (29-34), andtransportConfig.DialFromContextclonest.t.TLSClientConfigfrom the returned*http2.Transport(110-133). When the returned*http2.Transportis used,roundTripOptsetshttp2TransportContextKey{}(158-181), so the custom dial/TLS path can run and ignore anyt1.TLSClientConfig/ dial hooks that were on the wrapped*http.Transport.In this repo, however,
http2.ConfigureTransports(rt.(*http.Transport))is called and onlyhttp2t.ReadIdleTimeoutis set; the code continues to use the originalrtas the RoundTripper (vendor/github.com/prometheus/common/config/http_config.go:651-670), so the “direct*http2.TransportRoundTrip” dial/TLS behavior isn’t exercised here.Consider seeding
Transport.TLSClientConfig(and dial hooks) from the wrappedt1, or makingDialFromContextfall back tot1’s dial/TLS settings when the returnedTransportfields are unset.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@vendor/golang.org/x/net/http2/transport_wrap.go` around lines 29 - 34, configureTransports currently returns an empty &Transport{} so the returned Transport lacks TLS/dial settings from the wrapped *http.Transport (t1); update configureTransports to seed tr2 fields from t1 by copying TLSClientConfig and any dial hooks (e.g. DialContext / Dial / DialTLS equivalents used by Transport) into tr2 before calling tr2.configure(t1), and/or make Transport.DialFromContext fall back to t1's dial/TLS settings when tr2's TLSClientConfig or dial hooks are nil so DialFromContext uses t1's configuration if the returned Transport wasn't explicitly populated; reference configureTransports, Transport, tr2, t1, DialFromContext, TLSClientConfig, roundTripOpt and http2TransportContextKey when making the changes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@vendor/github.com/prometheus/common/config/http_config.go`:
- Around line 945-965: The token-fetch transport created in
NewOAuth2RoundTripper ignores HTTPClientOption.WithNewTLSConfigFunc because
oauth2RoundTripper.newOauth2TokenSource calls NewTLSConfig directly; change
newOauth2TokenSource to build tlsConfig via the configured opts.NewTLSConfigFunc
(or call opts.NewTLSConfigFunc if non-nil, falling back to NewTLSConfig) and
ensure the token HTTP transport uses that tlsConfig (and any other opts-derived
settings) so the token request honors the same TLS customization provided to
NewOAuth2RoundTripper via optFuncs.
In `@vendor/github.com/prometheus/common/version/info.go`:
- Around line 82-97: Slog() currently returns the raw Revision variable instead
of using the fallback logic in GetRevision(); update Slog() to call
GetRevision() for the "revision" entry so structured logs match Print()/Info()
behavior—modify the function Slog() to replace the "revision", Revision pair
with "revision", GetRevision() (retain other fields unchanged).
---
Nitpick comments:
In `@vendor/golang.org/x/net/http2/transport_wrap.go`:
- Around line 29-34: configureTransports currently returns an empty &Transport{}
so the returned Transport lacks TLS/dial settings from the wrapped
*http.Transport (t1); update configureTransports to seed tr2 fields from t1 by
copying TLSClientConfig and any dial hooks (e.g. DialContext / Dial / DialTLS
equivalents used by Transport) into tr2 before calling tr2.configure(t1), and/or
make Transport.DialFromContext fall back to t1's dial/TLS settings when tr2's
TLSClientConfig or dial hooks are nil so DialFromContext uses t1's configuration
if the returned Transport wasn't explicitly populated; reference
configureTransports, Transport, tr2, t1, DialFromContext, TLSClientConfig,
roundTripOpt and http2TransportContextKey when making the changes.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: f20fe45e-92d4-4460-aa58-9ed346ac9881
⛔ Files ignored due to path filters (1)
go.sumis excluded by!**/*.sum
📒 Files selected for processing (115)
go.modvendor/github.com/golang-jwt/jwt/v5/README.mdvendor/github.com/golang-jwt/jwt/v5/VERSION_HISTORY.mdvendor/github.com/golang-jwt/jwt/v5/parser.govendor/github.com/golang-jwt/jwt/v5/parser_option.govendor/github.com/golang-jwt/jwt/v5/token.govendor/github.com/golang-jwt/jwt/v5/validator.govendor/github.com/prometheus/common/config/http_config.govendor/github.com/prometheus/common/expfmt/openmetrics_create.govendor/github.com/prometheus/common/model/metric.govendor/github.com/prometheus/common/version/info.govendor/golang.org/x/net/http/httpproxy/proxy.govendor/golang.org/x/net/http2/README.mdvendor/golang.org/x/net/http2/client_conn_pool.govendor/golang.org/x/net/http2/clientconn.govendor/golang.org/x/net/http2/config.govendor/golang.org/x/net/http2/http2.govendor/golang.org/x/net/http2/server.govendor/golang.org/x/net/http2/server_common.govendor/golang.org/x/net/http2/server_wrap.govendor/golang.org/x/net/http2/transport.govendor/golang.org/x/net/http2/transport_common.govendor/golang.org/x/net/http2/transport_wrap.govendor/golang.org/x/net/http2/writesched.govendor/golang.org/x/net/http2/writesched_common.govendor/golang.org/x/net/http2/writesched_priority_rfc7540.govendor/golang.org/x/net/http2/writesched_priority_rfc9218.govendor/golang.org/x/net/http2/writesched_random.govendor/golang.org/x/net/http2/writesched_roundrobin.govendor/golang.org/x/net/idna/go118.govendor/golang.org/x/net/idna/idna.govendor/golang.org/x/net/idna/idna9.0.0.govendor/golang.org/x/net/idna/pre_go118.govendor/golang.org/x/net/idna/punycode.govendor/golang.org/x/net/idna/tables10.0.0.govendor/golang.org/x/net/idna/tables11.0.0.govendor/golang.org/x/net/idna/tables12.0.0.govendor/golang.org/x/net/idna/tables13.0.0.govendor/golang.org/x/net/idna/tables15.0.0.govendor/golang.org/x/net/idna/tables17.0.0.govendor/golang.org/x/net/idna/tables9.0.0.govendor/golang.org/x/net/idna/trie12.0.0.govendor/golang.org/x/net/idna/trie13.0.0.govendor/golang.org/x/net/internal/httpcommon/request.govendor/golang.org/x/sys/unix/mkerrors.shvendor/golang.org/x/sys/unix/readv_unix.govendor/golang.org/x/sys/unix/syscall_darwin.govendor/golang.org/x/sys/unix/syscall_linux.govendor/golang.org/x/sys/unix/syscall_openbsd.govendor/golang.org/x/sys/unix/zerrors_linux.govendor/golang.org/x/sys/unix/zerrors_linux_386.govendor/golang.org/x/sys/unix/zerrors_linux_amd64.govendor/golang.org/x/sys/unix/zerrors_linux_arm.govendor/golang.org/x/sys/unix/zerrors_linux_arm64.govendor/golang.org/x/sys/unix/zerrors_linux_loong64.govendor/golang.org/x/sys/unix/zerrors_linux_mips.govendor/golang.org/x/sys/unix/zerrors_linux_mips64.govendor/golang.org/x/sys/unix/zerrors_linux_mips64le.govendor/golang.org/x/sys/unix/zerrors_linux_mipsle.govendor/golang.org/x/sys/unix/zerrors_linux_ppc.govendor/golang.org/x/sys/unix/zerrors_linux_ppc64.govendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.govendor/golang.org/x/sys/unix/zerrors_linux_riscv64.govendor/golang.org/x/sys/unix/zerrors_linux_s390x.govendor/golang.org/x/sys/unix/zerrors_linux_sparc64.govendor/golang.org/x/sys/unix/zsyscall_linux.govendor/golang.org/x/sys/unix/zsyscall_openbsd_386.govendor/golang.org/x/sys/unix/zsyscall_openbsd_386.svendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.govendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.svendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.govendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.svendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.govendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.svendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.govendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.svendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.govendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.svendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.govendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.svendor/golang.org/x/sys/unix/zsysnum_linux_386.govendor/golang.org/x/sys/unix/zsysnum_linux_amd64.govendor/golang.org/x/sys/unix/zsysnum_linux_arm.govendor/golang.org/x/sys/unix/zsysnum_linux_arm64.govendor/golang.org/x/sys/unix/zsysnum_linux_loong64.govendor/golang.org/x/sys/unix/zsysnum_linux_mips.govendor/golang.org/x/sys/unix/zsysnum_linux_mips64.govendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.govendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.govendor/golang.org/x/sys/unix/zsysnum_linux_ppc.govendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.govendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.govendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.govendor/golang.org/x/sys/unix/zsysnum_linux_s390x.govendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.govendor/golang.org/x/sys/unix/ztypes_linux.govendor/golang.org/x/sys/unix/ztypes_linux_386.govendor/golang.org/x/sys/unix/ztypes_linux_amd64.govendor/golang.org/x/sys/unix/ztypes_linux_arm.govendor/golang.org/x/sys/unix/ztypes_linux_arm64.govendor/golang.org/x/sys/unix/ztypes_linux_loong64.govendor/golang.org/x/sys/unix/ztypes_linux_mips.govendor/golang.org/x/sys/unix/ztypes_linux_mips64.govendor/golang.org/x/sys/unix/ztypes_linux_mips64le.govendor/golang.org/x/sys/unix/ztypes_linux_mipsle.govendor/golang.org/x/sys/unix/ztypes_linux_ppc.govendor/golang.org/x/sys/unix/ztypes_linux_ppc64.govendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.govendor/golang.org/x/sys/unix/ztypes_linux_riscv64.govendor/golang.org/x/sys/unix/ztypes_linux_s390x.govendor/golang.org/x/sys/unix/ztypes_linux_sparc64.govendor/golang.org/x/sys/windows/syscall_windows.govendor/golang.org/x/sys/windows/types_windows.govendor/golang.org/x/sys/windows/zsyscall_windows.govendor/modules.txt
💤 Files with no reviewable changes (7)
- vendor/golang.org/x/net/idna/go118.go
- vendor/github.com/prometheus/common/model/metric.go
- vendor/golang.org/x/net/idna/trie12.0.0.go
- vendor/golang.org/x/net/idna/idna9.0.0.go
- vendor/golang.org/x/net/idna/pre_go118.go
- vendor/golang.org/x/net/idna/trie13.0.0.go
- vendor/golang.org/x/sys/unix/syscall_darwin.go
| // NewOAuth2RoundTripper returns a round tripper that performs OAuth2 | ||
| // authentication. The opts variadic parameter accepts any HTTPClientOption | ||
| // (e.g. WithDialContextFunc, WithKeepAlivesDisabled) so that callers outside | ||
| // this package can fully configure the transport without needing access to the | ||
| // unexported *httpClientOptions type. | ||
| func NewOAuth2RoundTripper(oauthCredential SecretReader, config *OAuth2, next http.RoundTripper, optFuncs ...HTTPClientOption) http.RoundTripper { | ||
| if oauthCredential == nil { | ||
| oauthCredential = NewInlineSecret("") | ||
| } | ||
|
|
||
| opts := defaultHTTPClientOptions | ||
| for _, opt := range optFuncs { | ||
| opt.applyToHTTPClientOptions(&opts) | ||
| } | ||
|
|
||
| return &oauth2RoundTripper{ | ||
| config: config, | ||
| // A correct tokenSource will be added later on. | ||
| lastRT: &oauth2.Transport{Base: next}, | ||
| opts: opts, | ||
| opts: &opts, | ||
| oauthCredential: oauthCredential, |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
rg -n "newTLSConfigFunc|NewTLSConfig\\(" vendor/github.com/prometheus/common/config/http_config.goRepository: kubeservice-stack/node-metrics
Length of output: 589
🏁 Script executed:
#!/bin/bash
set -euo pipefail
file="vendor/github.com/prometheus/common/config/http_config.go"
echo "== main TLS path (around opts.newTLSConfigFunc usage) =="
sed -n '700,770p' "$file" | nl -ba | sed -n '1,140p'
echo
echo "== OAuth2 token source TLS path (around line 974) =="
sed -n '930,1010p' "$file" | nl -ba | sed -n '1,140p'
echo
echo "== newOauth2TokenSource signature and how rt.opts is used =="
rg -n "func \\(rt \\*oauth2RoundTripper\\) newOauth2TokenSource" -n "$file"Repository: kubeservice-stack/node-metrics
Length of output: 192
🏁 Script executed:
#!/bin/bash
set -euo pipefail
file="vendor/github.com/prometheus/common/config/http_config.go"
num() { awk '{printf "%6d\t%s\n", NR, $0}'; }
echo "== main TLS path (opts.newTLSConfigFunc around previous match ~739) =="
sed -n '700,770p' "$file" | num | sed -n '1,120p'
echo
echo "== OAuth2 token-source TLS path (around ~974 match) =="
sed -n '940,1010p' "$file" | num | sed -n '1,120p'
echo
echo "== newOauth2TokenSource body (wider context) =="
rg -n "func \\(rt \\*oauth2RoundTripper\\) newOauth2TokenSource" "$file"
start=$(rg -n "func \\(rt \\*oauth2RoundTripper\\) newOauth2TokenSource" "$file" | head -n1 | cut -d: -f1)
# print from ~30 lines before to ~80 lines after (bounded)
from=$((start-30)); to=$((start+90))
sed -n "${from},${to}p" "$file" | numRepository: kubeservice-stack/node-metrics
Length of output: 10669
Fix OAuth2 token TLS to honor WithNewTLSConfigFunc
oauth2RoundTripper.newOauth2TokenSource builds tlsConfig via NewTLSConfig(...) directly, so WithNewTLSConfigFunc provided to NewOAuth2RoundTripper(..., optFuncs...) affects the main transport but not the token-fetch transport.
Proposed fix
func (rt *oauth2RoundTripper) newOauth2TokenSource(req *http.Request, clientCredential string) (client *http.Client, source oauth2.TokenSource, err error) {
- tlsConfig, err := NewTLSConfig(&rt.config.TLSConfig, WithSecretManager(rt.opts.secretManager))
+ tlsConfig, err := rt.opts.newTLSConfigFunc(req.Context(), &rt.config.TLSConfig, WithSecretManager(rt.opts.secretManager))
if err != nil {
return nil, nil, err
}🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@vendor/github.com/prometheus/common/config/http_config.go` around lines 945 -
965, The token-fetch transport created in NewOAuth2RoundTripper ignores
HTTPClientOption.WithNewTLSConfigFunc because
oauth2RoundTripper.newOauth2TokenSource calls NewTLSConfig directly; change
newOauth2TokenSource to build tlsConfig via the configured opts.NewTLSConfigFunc
(or call opts.NewTLSConfigFunc if non-nil, falling back to NewTLSConfig) and
ensure the token HTTP transport uses that tlsConfig (and any other opts-derived
settings) so the token request honors the same TLS customization provided to
NewOAuth2RoundTripper via optFuncs.
| // Slog returns a slice of strings for use with structured logging. | ||
| // | ||
| // Example: | ||
| // logger := promslog.New(promslog.Config{}) | ||
| // logger.Info("Starting Prometheus Server", version.Slog()...) | ||
| func Slog() []any { | ||
| return []any{ | ||
| "version", Version, | ||
| "revision", Revision, | ||
| "branch", Branch, | ||
| "builduser", BuildUser, | ||
| "builddate", BuildDate, | ||
| "goversion", GoVersion, | ||
| "goos", GoOS, | ||
| "goarch", GoArch, | ||
| } |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
rg -n "GetRevision\\(|\\bRevision\\b" vendor/github.com/prometheus/common/version/info.goRepository: kubeservice-stack/node-metrics
Length of output: 329
🏁 Script executed:
#!/bin/bash
set -euo pipefail
FILE="vendor/github.com/prometheus/common/version/info.go"
sed -n '75,115p' "$FILE"Repository: kubeservice-stack/node-metrics
Length of output: 1013
🏁 Script executed:
#!/bin/bash
set -euo pipefail
FILE="vendor/github.com/prometheus/common/version/info.go"
rg -n "func (Print|Info)\\b" "$FILE"Repository: kubeservice-stack/node-metrics
Length of output: 137
🏁 Script executed:
#!/bin/bash
set -euo pipefail
FILE="vendor/github.com/prometheus/common/version/info.go"
sed -n '45,85p' "$FILE"Repository: kubeservice-stack/node-metrics
Length of output: 1280
Use GetRevision() in Slog() to keep structured logging consistent
Slog() currently logs "revision", Revision (line 90), bypassing the GetRevision() fallback (Revision → computedRevision) that Print() and Info() already use.
Change to "revision", GetRevision().
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@vendor/github.com/prometheus/common/version/info.go` around lines 82 - 97,
Slog() currently returns the raw Revision variable instead of using the fallback
logic in GetRevision(); update Slog() to call GetRevision() for the "revision"
entry so structured logs match Print()/Info() behavior—modify the function
Slog() to replace the "revision", Revision pair with "revision", GetRevision()
(retain other fields unchanged).
Bumps github.com/prometheus/common from 0.67.5 to 0.68.1.
Release notes
Sourced from github.com/prometheus/common's releases.
Commits
2120573Update common Prometheus files (#915)228386abuild(deps): bump golang.org/x/net from 0.53.0 to 0.55.0 (#914)b8c88b4build(deps): bump golang.org/x/net from 0.52.0 to 0.53.0 (#903)1e0ae83config: apply DialContextFunc to OAuth2 token-fetch transport (#911)b51d01bRemove CircleCI (#910)0f3c348Merge pull request #908 from machine424/ttlsco732a9cffix(http_config): fix client cert rotation when no CA is configuredce9215cMove interface assertions to a test file (#839)1ba5ed7build(deps): bump golang.org/x/oauth2 from 0.34.0 to 0.36.0 (#892)8f8ada6build(deps): bump go.yaml.in/yaml/v2 from 2.4.3 to 2.4.4 (#891)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)Summary by CodeRabbit
New Features
Bug Fixes
Dependency Updates