Skip to content

[main] Merge upstream prometheus/main to 1b5649f869f0 - #1312

Merged
duricanikolic merged 15 commits into
mainfrom
bot/main/merge-upstream-main-202609111053
Sep 11, 2026
Merged

[main] Merge upstream prometheus/main to 1b5649f869f0#1312
duricanikolic merged 15 commits into
mainfrom
bot/main/merge-upstream-main-202609111053

Conversation

@mimir-github-bot

Copy link
Copy Markdown
Contributor

Merge Conflicts Detected

This PR was automatically created by the merge-upstream-prometheus workflow due to merge conflicts.

For reviewers: After conflicts are resolved, the author should post a comment with the output of git show --remerge-diff. This shows how merge conflicts were manually resolved compared to what Git would have done automatically, making conflict resolution transparent and allowing validation that conflicts were resolved correctly.

Details

youdie006 and others added 14 commits September 8, 2026 11:15
These fail on main: histogram_fraction over a native histogram with custom
buckets disagrees with the classic histogram it was converted from whenever a
bucket boundary is exactly 0.

Signed-off-by: manon <youdie006@users.noreply.github.com>
HistogramFraction treated any bucket with Lower <= 0 <= Upper as an exponential
zero bucket and rewrote its lower bound to 0. A native histogram with custom
buckets has no zero bucket, so the first bucket of an NHCB converted from a
classic histogram with le="0" had its range (-Inf, 0] collapsed to [0, 0],
dropping every observation at or below zero.

HistogramQuantile already gets this right a few hundred lines up: it gates the
zero-bucket branch on !h.UsesCustomBuckets() and treats the -Inf first bucket
separately. BucketFraction, the classic path, likewise uses -Inf as the lower
bound when the first bucket's upper bound is not positive. Apply the same rule
here.

Signed-off-by: manon <youdie006@users.noreply.github.com>
The two branches of ConvertNHCBToClassic disagree on span gaps. The
*FloatHistogram branch skips them with idx += int(span.Offset), keeping the
sparse buckets empty. The *Histogram branch instead wrote the running absolute
count into every gap bucket, and since positiveBuckets is cumulatively summed to
emit the classic le series, each empty bucket re-added the previous bucket's
count.

The same data through both branches, via h.ToFloat(nil):

  le      *Histogram  *FloatHistogram
  3.0     7           4
  10.0    53          35
  +Inf    53          35
  _count  35          35

So an integer NHCB with gaps produced a classic histogram whose +Inf bucket
contradicts its own _count. The sparse case in convert_test.go encoded that
output, including a comment spelling out the inflated sequence, so the
expectations are corrected here as well.

Adds a test asserting that an integer NHCB and its exact FloatHistogram
representation convert identically, and that +Inf equals the count.

Signed-off-by: manon <youdie006@users.noreply.github.com>
Signed-off-by: Yuri Nikolic <durica.nikolic@grafana.com>
…ption

--enable-feature=metadata-wal-records set scrape.AppendMetadata and
web.AppendMetadata, plus a cosmetic features.Enable() call, but never
set tsdb.Options.EnableMetadataWALRecords (tsdbOptions had no such
field). The classic storage.Appender.UpdateMetadata path doesn't check
that option, so this went unnoticed there, but AppenderV2 does
(EnableMetadataWALRecords && !opts.Metadata.IsEmpty()) and the scrape
manager prefers AppenderV2 whenever the storage implements it, which
tsdb.DB does. Net effect: the feature flag silently wrote no metadata
records at all via the default scrape path.

Add a regression test that exercises setFeatureListOptions directly
and asserts all three fields it's supposed to flip, rather than only
the two that happened to already work.

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…bled

Signed-off-by: Yuri Nikolic <durica.nikolic@grafana.com>
cmd/prometheus: wire metadata-wal-records feature flag to TSDB Head o…
PeekBack returns buffer-owned float histograms that may be overwritten when
the buffered iterator is reset for another series. Copy the histogram before
retaining it for federation output.

Signed-off-by: Michael Hoffmann <mhoffmann@cloudflare.com>
histogram: keep span gaps empty when unrolling an integer NHCB
…ts-le-zero

promql: fix histogram_fraction for custom buckets bounded at zero
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
…k-durable

tsdb: make the append-ID watermark check durable against later cleanup
…-float-histogram-reuse

web: retain float histograms during federation
…shot-comments

tsdb: clarify fingerprint snapshot concurrency guarantees
@mimir-github-bot

Copy link
Copy Markdown
Contributor Author

Action Required

This closed PR serves as a placeholder that holds the branch and instructions for conflict resolution. Follow these steps to resolve conflicts and reopen this PR:

# 1. Fetch and check out the empty branch created by CI
git fetch origin
git checkout bot/main/merge-upstream-main-202609111053

# 2. Fetch and merge the upstream commit to trigger conflicts
git remote add upstream https://github.com/prometheus/prometheus.git # Omit this step if you already have a remote configured for prometheus/prometheus.
git fetch upstream
git merge 1b5649f869f06eded7e0989d8b1ec4d08ab2cce8 --no-edit

# 3. If conflicts occur:
#    - Edit conflicted files and resolve conflicts
#    - Look for conflict markers: <<<<<<< HEAD, =======, >>>>>>>
#    - Remove conflict markers after resolving
#    - Run: git add . && git merge --continue

# 4. Push your resolved merge (no force-push needed)
git push

# 5. Re-open the closed PR

# 6. Post the remerge diff as a comment for reviewers:
gh pr comment --repo "grafana/mimir-prometheus" --body "## Merge Conflict Resolution

You can review how conflicts were resolved using:

\`\`\`bash
git show --remerge-diff
\`\`\`

<details>
<summary>Click to expand remerge diff output</summary>

\`\`\`diff
$(git show --remerge-diff)
\`\`\`

</details>" 1312

@github-actions github-actions Bot closed this Sep 11, 2026
@github-actions
github-actions Bot force-pushed the bot/main/merge-upstream-main-202609111053 branch from ff16b49 to 7d14de8 Compare September 11, 2026 10:54
mimir-vendoring[bot]
mimir-vendoring Bot previously approved these changes Sep 11, 2026

@mimir-vendoring mimir-vendoring Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm approving this upstream merge PR.
This PR merges changes from prometheus/prometheus upstream repository.
Related GitHub action is defined here.

…/merge-upstream-main-202609111053

# Conflicts:
#	cmd/prometheus/main.go
@github-actions

Copy link
Copy Markdown
Contributor

Signed commits report

4 of 15 commits between main and bot/main/merge-upstream-main-202609111053 could not be fully verified:

Commit Author Reason Message
3b40fbeb manon unsigned promql: add tests for histogram_fraction with a le="0" custom bucket
e3a04208 manon unsigned promql: fix histogram_fraction for custom buckets bounded at zero
1157c8d6 manon unsigned histogram: keep span gaps empty when unrolling an integer NHCB
4e362112 Michael Hoffmann unsigned web: retain float histograms during federation

This repository requires all commits to be signed. See GitHub docs on commit signature verification.

@cla-assistant

cla-assistant Bot commented Sep 11, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
3 out of 6 committers have signed the CLA.

✅ duricanikolic
✅ krajorama
✅ roidelapluie
❌ MichaHoffmann
❌ youdie006
❌ bwplotka
You have signed the CLA already but the status is still pending? Let us recheck it.

@duricanikolic

Copy link
Copy Markdown
Contributor

Merge Conflict Resolution

You can review how conflicts were resolved using:

git show --remerge-diff
Click to expand remerge diff output
commit a0061114116d0cb24031bdc8b5a23fe675685dd1
Merge: 7d14de8bd 1b5649f86
Author: Yuri Nikolic <durica.nikolic@grafana.com>
Date:   Fri Sep 11 13:10:07 2026 +0200

    Merge commit '1b5649f869f06eded7e0989d8b1ec4d08ab2cce8' into bot/main/merge-upstream-main-202609111053
    
    # Conflicts:
    #       cmd/prometheus/main.go

diff --git a/cmd/prometheus/main.go b/cmd/prometheus/main.go
remerge CONFLICT (content): Merge conflict in cmd/prometheus/main.go
index 316baa9e7..e64355d24 100644
--- a/cmd/prometheus/main.go
+++ b/cmd/prometheus/main.go
@@ -2151,7 +2151,6 @@ type tsdbOptions struct {
 
 func (opts tsdbOptions) ToTSDBOptions() tsdb.Options {
 	return tsdb.Options{
-<<<<<<< 7d14de8bd (Merge pull request #1310 from grafana/bot/main/merge-upstream-main-202609100930)
 		WALSegmentSize:                       int(opts.WALSegmentSize),
 		MaxBlockChunkSegmentSize:             int64(opts.MaxBlockChunkSegmentSize),
 		RetentionDuration:                    int64(time.Duration(opts.RetentionDuration) / time.Millisecond),
@@ -2181,40 +2180,9 @@ func (opts tsdbOptions) ToTSDBOptions() tsdb.Options {
 		StaleSeriesCompactionThreshold:       opts.StaleSeriesCompactionThreshold,
 		EnableFastStartup:                    opts.EnableFastStartup,
 		FloatChunkEncoding:                   opts.FloatChunkEncoding,
+		EnableMetadataWALRecords:             opts.EnableMetadataWALRecords,
 		HeadPostingsForMatchersCacheMetrics:  tsdb.NewPostingsForMatchersCacheMetrics(nil),
 		BlockPostingsForMatchersCacheMetrics: tsdb.NewPostingsForMatchersCacheMetrics(nil),
-=======
-		WALSegmentSize:                 int(opts.WALSegmentSize),
-		MaxBlockChunkSegmentSize:       int64(opts.MaxBlockChunkSegmentSize),
-		RetentionDuration:              int64(time.Duration(opts.RetentionDuration) / time.Millisecond),
-		MaxBytes:                       int64(opts.MaxBytes),
-		MaxPercentage:                  opts.MaxPercentage,
-		NoLockfile:                     opts.NoLockfile,
-		WALCompression:                 opts.WALCompressionType,
-		HeadChunksWriteQueueSize:       opts.HeadChunksWriteQueueSize,
-		SamplesPerChunk:                opts.SamplesPerChunk,
-		StripeSize:                     opts.StripeSize,
-		MinBlockDuration:               int64(time.Duration(opts.MinBlockDuration) / time.Millisecond),
-		MaxBlockDuration:               int64(time.Duration(opts.MaxBlockDuration) / time.Millisecond),
-		EnableExemplarStorage:          opts.EnableExemplarStorage,
-		MaxExemplars:                   opts.MaxExemplars,
-		EnableMemorySnapshotOnShutdown: opts.EnableMemorySnapshotOnShutdown,
-		OutOfOrderTimeWindow:           opts.OutOfOrderTimeWindow,
-		EnableDelayedCompaction:        opts.EnableDelayedCompaction,
-		CompactionDelayMaxPercent:      opts.CompactionDelayMaxPercent,
-		EnableOverlappingCompaction:    opts.EnableOverlappingCompaction,
-		UseUncachedIO:                  opts.UseUncachedIO,
-		BlockCompactionExcludeFunc:     opts.BlockCompactionExcludeFunc,
-		BlockReloadInterval:            time.Duration(opts.BlockReloadInterval),
-		FeatureRegistry:                features.DefaultRegistry,
-		EnableSTAsZeroSample:           opts.EnableSTAsZeroSample,
-		EnableSTStorage:                opts.EnableSTStorage,
-		EnableHistogramSTEncoding:      opts.EnableHistogramSTEncoding,
-		StaleSeriesCompactionThreshold: opts.StaleSeriesCompactionThreshold,
-		EnableFastStartup:              opts.EnableFastStartup,
-		FloatChunkEncoding:             opts.FloatChunkEncoding,
-		EnableMetadataWALRecords:       opts.EnableMetadataWALRecords,
->>>>>>> 1b5649f86 (Merge pull request #19680 from roidelapluie/roidelapluie/pr19672-snapshot-comments)
 	}
 }
 

@duricanikolic
duricanikolic marked this pull request as ready for review September 11, 2026 11:13
@duricanikolic
duricanikolic merged commit 544b719 into main Sep 11, 2026
36 of 37 checks passed
@duricanikolic
duricanikolic deleted the bot/main/merge-upstream-main-202609111053 branch September 11, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants