Skip to content

Commit 1bb5d05

Browse files
jchrostek-ddclaude
andcommitted
Address PR review feedback
- Change processing error response from BAD_REQUEST to INTERNAL_SERVER_ERROR - Add "as Protobuf" to error log messages for clarity - Add status code assertion to response validation integration test 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 08d3fbf commit 1bb5d05

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

bottlecap/src/otlp/agent.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ impl Agent {
165165
Err(e) => {
166166
error!("OTLP | Failed to process request: {:?}", e);
167167
return Self::otlp_error_response(
168-
StatusCode::BAD_REQUEST,
168+
StatusCode::INTERNAL_SERVER_ERROR,
169169
format!("Failed to process request: {e}"),
170170
encoding,
171171
);
@@ -248,7 +248,7 @@ impl Agent {
248248
};
249249
let mut buf = Vec::new();
250250
if let Err(e) = status.encode(&mut buf) {
251-
error!("OTLP | Failed to encode error response: {e}");
251+
error!("OTLP | Failed to encode error response as Protobuf: {e}");
252252
return (status_code, [(header::CONTENT_TYPE, "text/plain")], message)
253253
.into_response();
254254
}
@@ -284,7 +284,7 @@ impl Agent {
284284
OtlpEncoding::Protobuf => {
285285
let mut buf = Vec::new();
286286
if let Err(e) = response.encode(&mut buf) {
287-
error!("OTLP | Failed to encode success response: {e}");
287+
error!("OTLP | Failed to encode success response as Protobuf: {e}");
288288
return (
289289
StatusCode::INTERNAL_SERVER_ERROR,
290290
"Failed to encode response".to_string(),

integration-tests/tests/otlp.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,11 @@ describe('OTLP Integration Tests', () => {
9595
});
9696
});
9797

98-
describe('OTLP Response Validation (SVLS-8626)', () => {
98+
describe('OTLP Response Validation', () => {
99+
it('should invoke response validation Lambda successfully', () => {
100+
expect(results.responseValidation.statusCode).toBe(200);
101+
});
102+
99103
it('should have JSON encoded span in Datadog', () => {
100104
const allSpans = results.responseValidation.traces?.flatMap(t => t.spans) || [];
101105
const hasJsonSpan = allSpans.some(s =>

0 commit comments

Comments
 (0)