Skip to content

Conversation

@grobinson-grafana
Copy link
Contributor

@grobinson-grafana grobinson-grafana commented Jun 17, 2025

What this PR does / why we need it:

This commit updates the ingest-limits frontend to return streams with ReasonFailed if that stream could not be checked against per-tenant limits.

Stack on top of #18055.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Checklist

  • Reviewed the CONTRIBUTING.md guide (required)
  • Documentation added
  • Tests updated
  • Title matches the required conventional commits format, see here
    • Note that Promtail is considered to be feature complete, and future development for logs collection will be in Grafana Alloy. As such, feat PRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/setup/upgrade/_index.md
  • If the change is deprecating or removing a configuration option, update the deprecated-config.yaml and deleted-config.yaml files respectively in the tools/deprecated-config-checker directory. Example PR

@grobinson-grafana grobinson-grafana requested a review from a team as a code owner June 17, 2025 08:15
logger: logger,
gatherer: gatherer,
assignedPartitionsCache: assignedPartitionsCache,
streams: promauto.With(reg).NewCounter(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks to this I was able to move the metrics out of ring.go and into frontend.go.


// ReasonMaxStreams is returned when a stream cannot be accepted because
// the tenant has either reached or exceeded their maximum stream limit.
ReasonMaxStreams
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed to remove the Exceeds.

ReasonExceedsMaxStreams Reason = iota
// ReasonFailed is the reason returned when a stream cannot be checked
// against limits due to an error.
ReasonFailed Reason = iota + 1
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should have been iota + 1 to start with, made a mistake here.

for _, resp := range resps {
results = append(results, resp.Results...)
// If the entire call failed, then all streams failed.
for _, stream := range req.Streams {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This commit updates the ingest-limits frontend to return streams
with ReasonFailed if that stream could not be checked against
per-tenant limits.
@grobinson-grafana grobinson-grafana force-pushed the grobinson/return-failed-reason branch from 3c63b26 to 821730b Compare June 17, 2025 14:24
@grobinson-grafana grobinson-grafana merged commit c42ccc3 into main Jun 17, 2025
65 checks passed
@grobinson-grafana grobinson-grafana deleted the grobinson/return-failed-reason branch June 17, 2025 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants