Skip to content

Commit 117a2a0

Browse files
committed
style
1 parent ebee758 commit 117a2a0

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

relay-server/src/endpoints/spans.rs

+6-9
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,13 @@ where
2525
B::Data: Send + Into<Bytes>,
2626
B::Error: Into<axum::BoxError>,
2727
{
28-
let trace = if content_type.as_ref().starts_with("application/json") {
29-
let json: Json<TracesData> = request.extract().await?;
30-
Some(json.0)
28+
let trace: TracesData = if content_type.as_ref().starts_with("application/json") {
29+
let Json(trace) = request.extract().await?;
30+
trace
3131
} else if content_type.as_ref().starts_with("application/x-protobuf") {
32-
let protobuf: Protobuf<TracesData> = request.extract().await?;
33-
Some(protobuf.0)
32+
let Protobuf(trace) = request.extract().await?;
33+
trace
3434
} else {
35-
None
36-
};
37-
38-
let Some(trace) = trace else {
3935
return Ok(StatusCode::UNSUPPORTED_MEDIA_TYPE);
4036
};
4137

@@ -53,6 +49,7 @@ where
5349
}
5450
}
5551
common::handle_envelope(&state, envelope).await?;
52+
5653
Ok(StatusCode::ACCEPTED)
5754
}
5855

requirements-dev.txt

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ flake8==6.0.0
1010
confluent-kafka==2.1.1
1111
flask==2.2.2
1212
msgpack==1.0.4
13+
opentelemetry-proto==1.22.0
1314
pytest-localserver==0.7.0
1415
pytest-sentry==0.1.11
1516
pytest-xdist==3.0.2

0 commit comments

Comments
 (0)