Skip to content

Commit b2de6cc

Browse files
authored
chore: update tonic to 0.13 (#2876)
1 parent a071d8f commit b2de6cc

File tree

9 files changed

+42
-28
lines changed

9 files changed

+42
-28
lines changed

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[submodule "opentelemetry-proto/src/proto/opentelemetry-proto"]
22
path = opentelemetry-proto/src/proto/opentelemetry-proto
33
url = https://github.com/open-telemetry/opentelemetry-proto
4-
branch = tags/v1.0.0
4+
branch = tags/v1.5.0

Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ exclude = ["opentelemetry-prometheus"]
1919
debug = 1
2020

2121
[workspace.dependencies]
22-
async-std = "1.13"
2322
async-trait = "0.1"
2423
bytes = "1"
2524
criterion = "0.5"
@@ -42,8 +41,8 @@ serde = { version = "1.0", default-features = false }
4241
serde_json = "1.0"
4342
temp-env = "0.3.6"
4443
thiserror = { version = "2", default-features = false }
45-
tonic = { version = "0.12.3", default-features = false }
46-
tonic-build = "0.12"
44+
tonic = { version = "0.13", default-features = false }
45+
tonic-build = "0.13"
4746
tokio = { version = "1", default-features = false }
4847
tokio-stream = "0.1"
4948
# Using `tracing 0.1.40` because 0.1.39 (which is yanked) introduces the ability to set event names in macros,

opentelemetry-otlp/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## vNext
44

5+
- Update `tonic` dependency version to 0.13
6+
57
## 0.29.0
68

79
Released 2025-Mar-21

opentelemetry-otlp/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ opentelemetry_sdk = { features = ["trace", "rt-tokio", "testing"], path = "../op
4949
tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }
5050
futures-util = { workspace = true }
5151
temp-env = { workspace = true }
52-
tonic = { workspace = true, features = ["server"] }
52+
tonic = { workspace = true, features = ["router", "server"] }
5353

5454
[features]
5555
# telemetry pillars and functions
@@ -67,8 +67,8 @@ default = ["http-proto", "reqwest-blocking-client", "trace", "metrics", "logs",
6767
grpc-tonic = ["tonic", "prost", "http", "tokio", "opentelemetry-proto/gen-tonic"]
6868
gzip-tonic = ["tonic/gzip"]
6969
zstd-tonic = ["tonic/zstd"]
70-
tls = ["tonic/tls"]
71-
tls-roots = ["tls", "tonic/tls-roots"]
70+
tls = ["tonic/tls-ring"]
71+
tls-roots = ["tls", "tonic/tls-native-roots"]
7272
tls-webpki-roots = ["tls", "tonic/tls-webpki-roots"]
7373

7474
# http binary

opentelemetry-proto/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## vNext
44

5+
- Update `tonic` dependency version to 0.13
6+
57
## 0.29.0
68

79
Released 2025-Mar-21

opentelemetry-proto/src/proto/tonic/opentelemetry.proto.collector.logs.v1.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ pub mod logs_service_client {
9090
}
9191
impl<T> LogsServiceClient<T>
9292
where
93-
T: tonic::client::GrpcService<tonic::body::BoxBody>,
93+
T: tonic::client::GrpcService<tonic::body::Body>,
9494
T::Error: Into<StdError>,
9595
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
9696
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
@@ -111,13 +111,13 @@ pub mod logs_service_client {
111111
F: tonic::service::Interceptor,
112112
T::ResponseBody: Default,
113113
T: tonic::codegen::Service<
114-
http::Request<tonic::body::BoxBody>,
114+
http::Request<tonic::body::Body>,
115115
Response = http::Response<
116-
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
116+
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
117117
>,
118118
>,
119119
<T as tonic::codegen::Service<
120-
http::Request<tonic::body::BoxBody>,
120+
http::Request<tonic::body::Body>,
121121
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
122122
{
123123
LogsServiceClient::new(InterceptedService::new(inner, interceptor))
@@ -278,7 +278,7 @@ pub mod logs_service_server {
278278
B: Body + std::marker::Send + 'static,
279279
B::Error: Into<StdError> + std::marker::Send + 'static,
280280
{
281-
type Response = http::Response<tonic::body::BoxBody>;
281+
type Response = http::Response<tonic::body::Body>;
282282
type Error = std::convert::Infallible;
283283
type Future = BoxFuture<Self::Response, Self::Error>;
284284
fn poll_ready(
@@ -336,7 +336,9 @@ pub mod logs_service_server {
336336
}
337337
_ => {
338338
Box::pin(async move {
339-
let mut response = http::Response::new(empty_body());
339+
let mut response = http::Response::new(
340+
tonic::body::Body::default(),
341+
);
340342
let headers = response.headers_mut();
341343
headers
342344
.insert(

opentelemetry-proto/src/proto/tonic/opentelemetry.proto.collector.metrics.v1.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ pub mod metrics_service_client {
9090
}
9191
impl<T> MetricsServiceClient<T>
9292
where
93-
T: tonic::client::GrpcService<tonic::body::BoxBody>,
93+
T: tonic::client::GrpcService<tonic::body::Body>,
9494
T::Error: Into<StdError>,
9595
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
9696
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
@@ -111,13 +111,13 @@ pub mod metrics_service_client {
111111
F: tonic::service::Interceptor,
112112
T::ResponseBody: Default,
113113
T: tonic::codegen::Service<
114-
http::Request<tonic::body::BoxBody>,
114+
http::Request<tonic::body::Body>,
115115
Response = http::Response<
116-
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
116+
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
117117
>,
118118
>,
119119
<T as tonic::codegen::Service<
120-
http::Request<tonic::body::BoxBody>,
120+
http::Request<tonic::body::Body>,
121121
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
122122
{
123123
MetricsServiceClient::new(InterceptedService::new(inner, interceptor))
@@ -278,7 +278,7 @@ pub mod metrics_service_server {
278278
B: Body + std::marker::Send + 'static,
279279
B::Error: Into<StdError> + std::marker::Send + 'static,
280280
{
281-
type Response = http::Response<tonic::body::BoxBody>;
281+
type Response = http::Response<tonic::body::Body>;
282282
type Error = std::convert::Infallible;
283283
type Future = BoxFuture<Self::Response, Self::Error>;
284284
fn poll_ready(
@@ -336,7 +336,9 @@ pub mod metrics_service_server {
336336
}
337337
_ => {
338338
Box::pin(async move {
339-
let mut response = http::Response::new(empty_body());
339+
let mut response = http::Response::new(
340+
tonic::body::Body::default(),
341+
);
340342
let headers = response.headers_mut();
341343
headers
342344
.insert(

opentelemetry-proto/src/proto/tonic/opentelemetry.proto.collector.trace.v1.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ pub mod trace_service_client {
9090
}
9191
impl<T> TraceServiceClient<T>
9292
where
93-
T: tonic::client::GrpcService<tonic::body::BoxBody>,
93+
T: tonic::client::GrpcService<tonic::body::Body>,
9494
T::Error: Into<StdError>,
9595
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
9696
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
@@ -111,13 +111,13 @@ pub mod trace_service_client {
111111
F: tonic::service::Interceptor,
112112
T::ResponseBody: Default,
113113
T: tonic::codegen::Service<
114-
http::Request<tonic::body::BoxBody>,
114+
http::Request<tonic::body::Body>,
115115
Response = http::Response<
116-
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
116+
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
117117
>,
118118
>,
119119
<T as tonic::codegen::Service<
120-
http::Request<tonic::body::BoxBody>,
120+
http::Request<tonic::body::Body>,
121121
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
122122
{
123123
TraceServiceClient::new(InterceptedService::new(inner, interceptor))
@@ -278,7 +278,7 @@ pub mod trace_service_server {
278278
B: Body + std::marker::Send + 'static,
279279
B::Error: Into<StdError> + std::marker::Send + 'static,
280280
{
281-
type Response = http::Response<tonic::body::BoxBody>;
281+
type Response = http::Response<tonic::body::Body>;
282282
type Error = std::convert::Infallible;
283283
type Future = BoxFuture<Self::Response, Self::Error>;
284284
fn poll_ready(
@@ -336,7 +336,9 @@ pub mod trace_service_server {
336336
}
337337
_ => {
338338
Box::pin(async move {
339-
let mut response = http::Response::new(empty_body());
339+
let mut response = http::Response::new(
340+
tonic::body::Body::default(),
341+
);
340342
let headers = response.headers_mut();
341343
headers
342344
.insert(

opentelemetry-proto/src/proto/tonic/opentelemetry.proto.metrics.v1.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ pub struct Metric {
183183
#[prost(string, tag = "2")]
184184
pub description: ::prost::alloc::string::String,
185185
/// unit in which the metric value is reported. Follows the format
186-
/// described by <http://unitsofmeasure.org/ucum.html.>
186+
/// described by <https://unitsofmeasure.org/ucum.html.>
187187
#[prost(string, tag = "3")]
188188
pub unit: ::prost::alloc::string::String,
189189
/// Additional metadata attributes that describe the metric. \[Optional\].
@@ -292,7 +292,7 @@ pub struct ExponentialHistogram {
292292
}
293293
/// Summary metric data are used to convey quantile summaries,
294294
/// a Prometheus (see: <https://prometheus.io/docs/concepts/metric_types/#summary>)
295-
/// and OpenMetrics (see: <https://github.com/OpenObservability/OpenMetrics/blob/4dbf6075567ab43296eed941037c12951faafb92/protos/prometheus.proto#L45>)
295+
/// and OpenMetrics (see: <https://github.com/prometheus/OpenMetrics/blob/4dbf6075567ab43296eed941037c12951faafb92/protos/prometheus.proto#L45>)
296296
/// data type. These data points cannot always be merged in a meaningful way.
297297
/// While they can be useful in some applications, histogram data points are
298298
/// recommended for new applications.
@@ -448,7 +448,9 @@ pub struct HistogramDataPoint {
448448
/// The sum of the bucket_counts must equal the value in the count field.
449449
///
450450
/// The number of elements in bucket_counts array must be by one greater than
451-
/// the number of elements in explicit_bounds array.
451+
/// the number of elements in explicit_bounds array. The exception to this rule
452+
/// is when the length of bucket_counts is 0, then the length of explicit_bounds
453+
/// must also be 0.
452454
#[prost(fixed64, repeated, tag = "6")]
453455
pub bucket_counts: ::prost::alloc::vec::Vec<u64>,
454456
/// explicit_bounds specifies buckets with explicitly defined bounds for values.
@@ -464,6 +466,9 @@ pub struct HistogramDataPoint {
464466
/// Histogram buckets are inclusive of their upper boundary, except the last
465467
/// bucket where the boundary is at infinity. This format is intentionally
466468
/// compatible with the OpenMetrics histogram definition.
469+
///
470+
/// If bucket_counts length is 0 then explicit_bounds length must also be 0,
471+
/// otherwise the data point is invalid.
467472
#[prost(double, repeated, tag = "7")]
468473
pub explicit_bounds: ::prost::alloc::vec::Vec<f64>,
469474
/// (Optional) List of exemplars collected from

0 commit comments

Comments
 (0)