Skip to content

fix(otlp): Write protobuf status on error #15097

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

Merged
merged 2 commits into from
Nov 26, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
CR feedback
  • Loading branch information
salvacorts committed Nov 25, 2024
commit f9da45d9dfc2b39d459214ca8e2df7f3e3d884bc
4 changes: 2 additions & 2 deletions pkg/loghttp/push/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ func OTLPError(w http.ResponseWriter, error string, code int, logger log.Logger)
level.Error(logger).Log("msg", "failed to marshal error response", "error", err)
writeResponseFailedBody, _ := proto.Marshal(grpcstatus.New(
codes.Internal,
fmt.Sprintf("failed to marshal error response. original error: %s", err.Error()),
fmt.Sprintf("failed to marshal error response: %s", err.Error()),
).Proto())
_, _ = w.Write(writeResponseFailedBody)
return
Expand All @@ -356,7 +356,7 @@ func OTLPError(w http.ResponseWriter, error string, code int, logger log.Logger)
level.Error(logger).Log("msg", "failed to write error response", "error", err)
writeResponseFailedBody, _ := proto.Marshal(grpcstatus.New(
codes.Internal,
fmt.Sprintf("failed write error. original error: %s", err.Error()),
fmt.Sprintf("failed write error: %s", err.Error()),
).Proto())
_, _ = w.Write(writeResponseFailedBody)
}
Expand Down
Loading