Support Start TimeStamp (ST) & Created Timestamp (CT) on PRW2#7371
Open
SungJin1212 wants to merge 6 commits intocortexproject:masterfrom
Open
Support Start TimeStamp (ST) & Created Timestamp (CT) on PRW2#7371SungJin1212 wants to merge 6 commits intocortexproject:masterfrom
SungJin1212 wants to merge 6 commits intocortexproject:masterfrom
Conversation
Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
friedrichg
reviewed
Mar 25, 2026
pkg/ingester/ingester.go
Outdated
| if hp.StartTimestampMs != 0 && hp.TimestampMs != 0 { | ||
| // TODO(SungJin1212): Change to AppendHistogramSTZeroSample after update the Prometheus v3.9.0+ | ||
| if _, err = app.AppendHistogramCTZeroSample(ref, copiedLabels, hp.TimestampMs, hp.StartTimestampMs, h, fh); err != nil && !errors.Is(err, storage.ErrOutOfOrderCT) { | ||
| level.Warn(logutil.WithContext(ctx, i.logger)).Log("msg", "failed to append start timestamp for histogram", "user", userID, "series", copiedLabels.String(), "timestamp", hp.TimestampMs, "start_timestamp", hp.StartTimestampMs, "err", err) |
Member
There was a problem hiding this comment.
Logging per sample is impossible to run at scale.
Maybe consider adding a metric like this
// In newIngesterMetrics():
startTimestampFail: promauto.With(r).NewCounter(prometheus.CounterOpts{
Name: "cortex_ingester_start_timestamp_failures_total",
Help: "The total number of start timestamp zero samples that errored on ingestion.",
}),
Member
Author
There was a problem hiding this comment.
Sound good, what about setting these logs as Debug and adding some metrics to track them?
Member
There was a problem hiding this comment.
Debug log should be fine but maybe for the push, not for every sample. See the end of the method.
Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prometheus has updated its model to use Start Timestamps (ST) at the sample/histogram level instead of Created Timestamps (CT) at the series level. This PR implements support for ingesting both start timestamps (ST) and created timestamps (CT, as a fallback for pre-Prometheus v3.8.0 model) via Prometheus Remote Write (PRW) 2.0.
Which issue(s) this PR fixes:
Fixes #7060
Checklist
CHANGELOG.mdupdated - the order of entries should be[CHANGE],[FEATURE],[ENHANCEMENT],[BUGFIX]