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

fix: Return error 422 (Unprocessable Content) when push request does not contain any streams #13706

Merged
merged 2 commits into from
Dec 13, 2024

Conversation

ravishankar15
Copy link
Contributor

@ravishankar15 ravishankar15 commented Jul 30, 2024

What this PR does / why we need it:

Which issue(s) this PR fixes:
Fixes #13399

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

@ravishankar15 ravishankar15 requested a review from a team as a code owner July 30, 2024 02:35
@CLAassistant
Copy link

CLAassistant commented Jul 30, 2024

CLA assistant check
All committers have signed the CLA.

@ravishankar15 ravishankar15 force-pushed the validation-error-fix branch 2 times, most recently from ed20552 to 222564b Compare August 30, 2024 20:53
@ravishankar15
Copy link
Contributor Author

Can someone take a look at this PR its a small fix

@chaudum chaudum changed the title fix: Fix validation error message for push request fix: Return error 422 (Unprocessable Content) when push request does not contain any streams Nov 29, 2024
Copy link
Contributor

@chaudum chaudum left a comment

Choose a reason for hiding this comment

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

@ravishankar15 One suggestion, otherwise LGTM

@@ -11,7 +11,9 @@ import (
)

const (
ReasonLabel = "reason"
ReasonLabel = "reason"
MissingStreams = "error at least one valid stream is required for ingestion"
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I would use the same naming convention as for other error messages

Suggested change
MissingStreams = "error at least one valid stream is required for ingestion"
MissingStreamsErrorMsg = "error at least one valid stream is required for ingestion"

@chaudum chaudum merged commit 17bf32b into grafana:main Dec 13, 2024
58 checks passed
mveitas pushed a commit to mveitas/loki that referenced this pull request Jan 6, 2025
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.

Some invalid push payloads are accepted and return 204 but store no data
3 participants