Skip to content

Commit

Permalink
feat(otlp): add openssl feature flags for grpcio (#367)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacasonato committed Nov 22, 2020
1 parent d3984fc commit 6249046
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
4 changes: 4 additions & 0 deletions opentelemetry-otlp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ grpcio = "0.6"
opentelemetry = { version = "0.10", default-features = false, features = ["trace"], path = "../opentelemetry" }
protobuf = "2.18"

[features]
openssl = ["grpcio/openssl"]
openssl-vendored = ["grpcio/openssl-vendored"]

[build-dependencies]
protobuf-codegen = "2.16"
protoc-grpcio = "2.0"
13 changes: 13 additions & 0 deletions opentelemetry-otlp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,16 @@ fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
Ok(())
}
```

## Feature flags

By default `opentelemetry-otlp` uses `boringssl` for grpc crypto. You can switch
this to use `openssl` by enabling the `openssl` feature:

```toml
[dependencies]
opentelemetry-otlp = { version = "*", features = ["openssl"] }
```

If you would like to use a vendored `openssl` version, use the `openssl-vendored` feature.
For more info, see https://github.com/tikv/grpc-rs#feature-openssl-and-openssl-vendored.
12 changes: 12 additions & 0 deletions opentelemetry-otlp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,18 @@
//! Ok(())
//! }
//! ```
//! ## Feature flags
//!
//! By default `opentelemetry-otlp` uses `boringssl` for grpc crypto. You can switch
//! this to use `openssl` by enabling the `openssl` feature:
//!
//! ```toml
//! [dependencies]
//! opentelemetry-otlp = { version = "*", features = ["openssl"] }
//! ```
//!
//! If you would like to use a vendored `openssl` version, use the `openssl-vendored` feature.
//! For more info, see https://github.com/tikv/grpc-rs#feature-openssl-and-openssl-vendored.
#![warn(
future_incompatible,
missing_debug_implementations,
Expand Down

0 comments on commit 6249046

Please sign in to comment.