Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Limit for blocking ingestion until configured date #13958

Merged
merged 2 commits into from
Aug 27, 2024

Conversation

salvacorts
Copy link
Contributor

@salvacorts salvacorts commented Aug 26, 2024

What this PR does / why we need it:
This PR introduces two new limits to block ingestion until a configurable date.

  • block_ingestion_until: Configures the date till when Loki will block ingestion
  • block_ingestion_status_code: Configures the status code to return when ingestion is blocked.
    • By default we return a custom status code (260). If it's configured to 200, we block, log the error in Loki, but return a success response to the client.
    • This limit gives us flexibility to customise the status code per client.

When ingestion is blocked, the discarded bytes and lines metric are updated with a new reason: blocked_ingestion.

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
  • For Helm chart changes bump the Helm chart version in production/helm/loki/Chart.yaml and update production/helm/loki/CHANGELOG.md and production/helm/loki/README.md. Example PR
  • 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

@github-actions github-actions bot added the type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories label Aug 26, 2024
@salvacorts salvacorts marked this pull request as ready for review August 26, 2024 11:08
@salvacorts salvacorts requested a review from a team as a code owner August 26, 2024 11:08
Copy link
Contributor

@vlad-diachenko vlad-diachenko left a comment

Choose a reason for hiding this comment

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

looks ideal ... let's just change the default status code

# will be blocked without returning an error to the client. By Default, a custom
# error (460) is returned to the client along with an error message.
# CLI flag: -limits.block-ingestion-status-code
[block_ingestion_status_code: <int> | default = 460]
Copy link
Contributor

Choose a reason for hiding this comment

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

according to discussions in the design doc, it looks like we need to return successful status code by default, some 2xx ...
it will guarantee us that regardless of the client type, the clients won't re-send us the data

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@salvacorts salvacorts merged commit b5ac6a0 into main Aug 27, 2024
63 checks passed
@salvacorts salvacorts deleted the salvacorts/add-block-until-limit branch August 27, 2024 07:33
@salvacorts salvacorts changed the title feat: Limit to block ingestion until configured date feat: Limit ingestion until configured date Aug 28, 2024
@salvacorts salvacorts changed the title feat: Limit ingestion until configured date feat: Limit for blocking ingestion until configured date Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/L type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants