Skip to content

feat: improve dropped point logging#26257

Merged
davidby-influx merged 5 commits intomaster-1.xfrom
DSB_dropped_logging
Apr 18, 2025
Merged

feat: improve dropped point logging#26257
davidby-influx merged 5 commits intomaster-1.xfrom
DSB_dropped_logging

Conversation

@davidby-influx
Copy link
Copy Markdown
Contributor

Log the reason for a point being dropped,
the type of boundary violated, and the
time that was the boundary. Prints the
maximum and minimum points (by time)
that were dropped

closes #26252

@davidby-influx davidby-influx self-assigned this Apr 12, 2025
@davidby-influx davidby-influx marked this pull request as ready for review April 14, 2025 21:21
if s.Dropped() <= 0 {
return ""
}
return fmt.Sprintf("dropped %d points outside retention policy and %d points outside write window: %s to %s",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we want to include the retention policy and/or write window bounds in the summary? Might make debugging customer issues easier, especially if their retention or write window is now what they think it is.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

DroppedPoint.String() prints that information, so we get it for the max and min points.

Log the reason for a point being dropped,
the type of boundary violated, and the
time that was the boundary. Prints the
maximum and minimum points (by time)
that were dropped

closes #26252
devanbenz
devanbenz previously approved these changes Apr 17, 2025
Copy link
Copy Markdown

@devanbenz devanbenz left a comment

Choose a reason for hiding this comment

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

LGTM

atomic.AddInt64(&w.stats.SubWriteOK, 1)

if err == nil && len(shardMappings.Dropped) > 0 {
err = tsdb.PartialWriteError{Reason: "points beyond retention policy or outside permissible write window",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The new code would have an error message of "dropped %d points outside retention policy of duration". I assume this message is what the client will receive. Any risk of this breaking any client libraries or C1 alerting?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In theory, it could break picky client code, but my hope is that people are switching on the 4XX HTTP error, not the message text.

Copy link
Copy Markdown
Member

@gwossum gwossum left a comment

Choose a reason for hiding this comment

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

LGTM

@davidby-influx davidby-influx merged commit 62e803e into master-1.x Apr 18, 2025
9 checks passed
@davidby-influx davidby-influx deleted the DSB_dropped_logging branch April 18, 2025 22:18
davidby-influx added a commit that referenced this pull request Apr 22, 2025
Log the reason for a point being dropped,
the type of boundary violated, and the
time that was the boundary. Prints the
maximum and minimum points (by time)
that were dropped

closes #26252

* fix: better time formatting and additional testing

* fix: differentiate point time boundary violations

* chore: clean up switch statement

* fix: improve error messages

(cherry picked from commit 62e803e)

closes #26295
devanbenz pushed a commit that referenced this pull request Sep 24, 2025
Log the reason for a point being dropped,
the type of boundary violated, and the
time that was the boundary. Prints the
maximum and minimum points (by time)
that were dropped

closes #26252

* fix: better time formatting and additional testing

* fix: differentiate point time boundary violations

* chore: clean up switch statement

* fix: improve error messages

(cherry picked from commit 62e803e)
devanbenz added a commit that referenced this pull request Sep 25, 2025
Co-authored-by: davidby-influx <72418212+davidby-influx@users.noreply.github.com>
closes #26252
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants