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(otel): Map 500 errors to 503 #13173

Merged
merged 6 commits into from
Jun 7, 2024
Merged

Conversation

salvacorts
Copy link
Contributor

What this PR does / why we need it:

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
  • 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

@pull-request-size pull-request-size bot added size/S and removed size/M labels Jun 7, 2024
@pull-request-size pull-request-size bot added size/M and removed size/S labels Jun 7, 2024
Comment on lines 35 to 40
func (i *OtelErrorHeaderInterceptor) WriteHeader(statusCode int) {
if statusCode == http.StatusInternalServerError {
i.ResponseWriter.WriteHeader(http.StatusServiceUnavailable)
} else {
i.ResponseWriter.WriteHeader(statusCode)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a comment why we are doing this, e.g. link the OTLP spec https://opentelemetry.io/docs/specs/otlp/#failures-1

@slim-bean slim-bean marked this pull request as ready for review June 7, 2024 14:26
@slim-bean slim-bean requested a review from a team as a code owner June 7, 2024 14:26
@slim-bean slim-bean merged commit b31e04e into main Jun 7, 2024
59 checks passed
@slim-bean slim-bean deleted the salvacorts/map-500-error-to-503-otel branch June 7, 2024 14:40
@slim-bean slim-bean added type/bug Somehing is not working as expected backport k205 labels Jun 7, 2024
grafanabot pushed a commit that referenced this pull request Jun 7, 2024
grafanabot pushed a commit that referenced this pull request Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport k204 backport k205 size/M type/bug Somehing is not working as expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants