Skip to content

Commit bd0af70

Browse files
re-export cherry-picked tonic types
1 parent 710b2b2 commit bd0af70

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

opentelemetry-otlp/allowed-external-types.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ allowed_external_types = [
1313
# prost is a pre 1.0 crate
1414
"prost::error::EncodeError",
1515
# tonic is a pre 1.0 crate
16-
"tonic",
1716
"tonic::status::Code",
1817
"tonic::status::Status",
1918
"tonic::metadata::map::MetadataMap",
19+
"tonic::transport::channel::tls::ClientTlsConfig",
20+
"tonic::transport::tls::Certificate",
21+
"tonic::transport::tls::Identity",
2022
"tonic::transport::channel::Channel",
2123
"tonic::transport::error::Error",
2224
"tonic::service::interceptor::Interceptor",

opentelemetry-otlp/src/lib.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,5 +452,15 @@ pub enum Protocol {
452452
pub struct NoExporterConfig(());
453453

454454
#[cfg(feature = "grpc-tonic")]
455-
#[doc(no_inline)]
456-
pub use tonic;
455+
pub mod tonic_types {
456+
pub mod metadata {
457+
#[doc(no_inline)]
458+
pub use tonic::metadata::MetadataMap;
459+
}
460+
461+
#[cfg(feature = "tls")]
462+
pub mod transport {
463+
#[doc(no_inline)]
464+
pub use tonic::transport::{Certificate, ClientTlsConfig, Identity};
465+
}
466+
}

0 commit comments

Comments
 (0)