Skip to content

Commit 6249046

Browse files
authored
feat(otlp): add openssl feature flags for grpcio (open-telemetry#367)
1 parent d3984fc commit 6249046

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

opentelemetry-otlp/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ grpcio = "0.6"
2727
opentelemetry = { version = "0.10", default-features = false, features = ["trace"], path = "../opentelemetry" }
2828
protobuf = "2.18"
2929

30+
[features]
31+
openssl = ["grpcio/openssl"]
32+
openssl-vendored = ["grpcio/openssl-vendored"]
33+
3034
[build-dependencies]
3135
protobuf-codegen = "2.16"
3236
protoc-grpcio = "2.0"

opentelemetry-otlp/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,3 +120,16 @@ fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
120120
Ok(())
121121
}
122122
```
123+
124+
## Feature flags
125+
126+
By default `opentelemetry-otlp` uses `boringssl` for grpc crypto. You can switch
127+
this to use `openssl` by enabling the `openssl` feature:
128+
129+
```toml
130+
[dependencies]
131+
opentelemetry-otlp = { version = "*", features = ["openssl"] }
132+
```
133+
134+
If you would like to use a vendored `openssl` version, use the `openssl-vendored` feature.
135+
For more info, see https://github.com/tikv/grpc-rs#feature-openssl-and-openssl-vendored.

opentelemetry-otlp/src/lib.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,18 @@
9595
//! Ok(())
9696
//! }
9797
//! ```
98+
//! ## Feature flags
99+
//!
100+
//! By default `opentelemetry-otlp` uses `boringssl` for grpc crypto. You can switch
101+
//! this to use `openssl` by enabling the `openssl` feature:
102+
//!
103+
//! ```toml
104+
//! [dependencies]
105+
//! opentelemetry-otlp = { version = "*", features = ["openssl"] }
106+
//! ```
107+
//!
108+
//! If you would like to use a vendored `openssl` version, use the `openssl-vendored` feature.
109+
//! For more info, see https://github.com/tikv/grpc-rs#feature-openssl-and-openssl-vendored.
98110
#![warn(
99111
future_incompatible,
100112
missing_debug_implementations,

0 commit comments

Comments
 (0)