Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: prometheus/common
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.68.1
Choose a base ref
...
head repository: prometheus/common
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.69.0
Choose a head ref
  • 18 commits
  • 31 files changed
  • 4 contributors

Commits on May 27, 2026

  1. config: strip credentials on cross-host redirects

    When FollowRedirects is true, credentials (Authorization header, Cookie
    headers set via HTTPHeaders) were forwarded to any redirect target,
    including cross-host redirects.
    
    Fix by detecting cross-host redirects via isCrossHostRedirect, which
    walks the req.Response chain to find the original request's hostname and
    compares it to the current destination. Each credential round-tripper
    (bearer, basic auth, OAuth2) skips adding credentials when
    isCrossHostRedirect returns true. A new sensitiveHeadersStripRT also
    strips sensitive headers added by headersRoundTripper on cross-host
    redirects.
    
    This approach requires no CheckRedirect hook and works whether the
    caller uses NewClientFromConfig or a custom http.Client built from
    NewRoundTripperFromConfigWithContext directly.
    
    This aligns to Go's HTTP client behaviour.
    
    Signed-off-by: Julien Pivotto <[email protected]>
    roidelapluie committed May 27, 2026
    Configuration menu
    Copy the full SHA
    0d8de87 View commit details
    Browse the repository at this point in the history

Commits on Jun 8, 2026

  1. Modernize Go

    * Enable modernize linter
    * Add linter exceptions to match upstream Prometheus.
    * Apply linter improvements.
    
    Signed-off-by: SuperQ <[email protected]>
    SuperQ committed Jun 8, 2026
    Configuration menu
    Copy the full SHA
    56870db View commit details
    Browse the repository at this point in the history
  2. model: Add BenchmarkUnmarshalTime

    Signed-off-by: Bryan Boreham <[email protected]>
    bboreham committed Jun 8, 2026
    Configuration menu
    Copy the full SHA
    4cc12e3 View commit details
    Browse the repository at this point in the history
  3. model: reduce allocations in Time.UnmarshalJSON

    Use strings.Cut instead of strings.Split.
    
    Signed-off-by: Bryan Boreham <[email protected]>
    bboreham committed Jun 8, 2026
    Configuration menu
    Copy the full SHA
    98ca625 View commit details
    Browse the repository at this point in the history
  4. model: remove allocation in Time.UnmarshalJSON

    We don't need to modify the string version of the number via a memory
    allocation; it's much faster to modify the integer version.
    
    Signed-off-by: Bryan Boreham <[email protected]>
    bboreham committed Jun 8, 2026
    Configuration menu
    Copy the full SHA
    8b99aea View commit details
    Browse the repository at this point in the history
  5. model: fix Time.UnmarshalJSON for larger negative numbers

    Signed-off-by: Bryan Boreham <[email protected]>
    bboreham committed Jun 8, 2026
    Configuration menu
    Copy the full SHA
    d6a7988 View commit details
    Browse the repository at this point in the history

Commits on Jun 9, 2026

  1. Update common Prometheus files (#917)

    Signed-off-by: prombot <[email protected]>
    prombot authored Jun 9, 2026
    Configuration menu
    Copy the full SHA
    c4a7162 View commit details
    Browse the repository at this point in the history

Commits on Jun 11, 2026

  1. Merge pull request #901 from roidelapluie/roidelapluie/fixredirectauth

    config: strip credentials on cross-host redirects
    roidelapluie authored Jun 11, 2026
    Configuration menu
    Copy the full SHA
    c7fb7bb View commit details
    Browse the repository at this point in the history
  2. config: make isCrossHostRedirect sticky across the redirect chain

    Walk every hop in the redirect chain rather than only checking the
    current request's host. Once any hop leaves the original host, the
    function returns true for all subsequent requests in that chain, even
    if a later hop redirects back to the original host.
    
    This mirrors net/http's own behaviour and closes the bypass window
    where a cross→original→cross chain could slip credentials through.
    
    Signed-off-by: Julien Pivotto <[email protected]>
    roidelapluie committed Jun 11, 2026
    Configuration menu
    Copy the full SHA
    428856f View commit details
    Browse the repository at this point in the history
  3. config: check cross-host redirect before OAuth2 token fetch

    Move isCrossHostRedirect early in oauth2RoundTripper.RoundTrip so that
    cross-host redirects bypass token-source initialisation entirely and go
    straight to Base.RoundTrip. Base is read under the RLock to avoid a
    data race with concurrent reconfigurations.
    
    Signed-off-by: Julien Pivotto <[email protected]>
    roidelapluie committed Jun 11, 2026
    Configuration menu
    Copy the full SHA
    2b55b3e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    30ba470 View commit details
    Browse the repository at this point in the history
  5. Merge pull request #920 from roidelapluie/roidelapluie/cross-host-sticky

    config: make isCrossHostRedirect sticky across the redirect chain
    roidelapluie authored Jun 11, 2026
    Configuration menu
    Copy the full SHA
    0fcda47 View commit details
    Browse the repository at this point in the history
  6. Merge pull request #921 from roidelapluie/roidelapluie/oauth2-cross-h…

    …ost-check
    
    config: check cross-host redirect before OAuth2 token fetch
    roidelapluie authored Jun 11, 2026
    Configuration menu
    Copy the full SHA
    56fe395 View commit details
    Browse the repository at this point in the history
  7. expfmt: fix nil pointer panic when parsing empty braces "{}"

    The text exposition parser panics with a nil pointer dereference when it
    encounters a closing brace before any metric name has been read, e.g. for
    the input "{}". In startOfLine a leading "{" sets currentMetricIsInsideBraces
    and jumps straight to label parsing without going through readingMetricName,
    so currentMF/currentMetric are still nil when startLabelName dereferences
    currentMetric on the "}" branch.
    
    Since TextToMetricFamilies is used to decode untrusted scrape payloads, a
    malicious or compromised target could crash any consumer that does not wrap
    the parser in its own recover().
    
    Guard the "}" branch on currentMF == nil and return a parse error, mirroring
    the existing guard in startLabelValue. currentMF is checked rather than
    currentMetric because reset only clears currentMF between parses.
    
    Introduced in #670.
    
    Signed-off-by: Julien Pivotto <[email protected]>
    roidelapluie committed Jun 11, 2026
    Configuration menu
    Copy the full SHA
    a1600af View commit details
    Browse the repository at this point in the history

Commits on Jun 12, 2026

  1. Merge pull request #922 from roidelapluie/roidelapluie/fix-textparse-…

    …empty-braces-panic
    
    expfmt: fix nil pointer panic when parsing empty braces "{}"
    roidelapluie authored Jun 12, 2026
    Configuration menu
    Copy the full SHA
    2269d3d View commit details
    Browse the repository at this point in the history
  2. Merge pull request #918 from prometheus/time-split

    model: reduce allocations in Time.UnmarshalJSON
    roidelapluie authored Jun 12, 2026
    Configuration menu
    Copy the full SHA
    f84efec View commit details
    Browse the repository at this point in the history

Commits on Jun 17, 2026

  1. config: resolve LoadHTTPConfigFile paths relative to the config file

    LoadHTTPConfigFile called SetDirectory with filepath.Dir(filepath.Dir(filename)),
    resolving relative file paths (http_headers files, *_file credentials) against the
    config file's grandparent directory instead of its own directory. This contradicts
    the SetDirectory contract and every other config loader.
    
    The behavior was masked by the testdata fixtures, which prefixed file paths with
    the config file's own directory name (e.g. files: [testdata/headers-file] for a
    config living in testdata/) to compensate. Drop those redundant prefixes and add a
    regression test that loads a config from a temp dir and asserts a plain relative
    path resolves next to the config file.
    
    Signed-off-by: Julien Pivotto <[email protected]>
    roidelapluie committed Jun 17, 2026
    Configuration menu
    Copy the full SHA
    a7b791d View commit details
    Browse the repository at this point in the history
  2. Merge pull request #925 from roidelapluie/roidelapluie/fix-loadhttpco…

    …nfigfile-dir
    
    config: resolve LoadHTTPConfigFile paths relative to the config file
    roidelapluie authored Jun 17, 2026
    Configuration menu
    Copy the full SHA
    e3c14a0 View commit details
    Browse the repository at this point in the history
Loading