|
| 1 | +#![cfg_attr(doc, feature(doc_auto_cfg))] |
1 | 2 | //! This crate contains generated files from [opentelemetry-proto](https://github.com/open-telemetry/opentelemetry-proto)
|
2 | 3 | //! repository and transformation between types from generated files and types defined in [opentelemetry](https://github.com/open-telemetry/opentelemetry-rust/tree/main/opentelemetry)
|
3 | 4 | //!
|
4 | 5 | //! Based on the build tool needed, users can choose to generate files using [tonic](https://github.com/hyperium/tonic)
|
5 | 6 | //! or [grpcio](https://github.com/tikv/grpc-rs).
|
6 | 7 | //!
|
| 8 | +//! |
7 | 9 | //! # Feature flags
|
8 | 10 | //! `Opentelemetry-proto` includes a set of feature flags to avoid pull in unnecessary dependencies.
|
9 | 11 | //! The following is the full list of currently supported features:
|
10 | 12 | //!
|
| 13 | +//! ## Signals |
| 14 | +//! - `traces`: generate types that used in traces. Currently supports `gen-tonic` or `gen-protoc`. |
| 15 | +//! - `metrics`: generate types that used in metrics. Currently supports `gen-tonic`. |
| 16 | +//! - `logs`: generate types that used in logs. Currently supports `gen-tonic`. |
| 17 | +//! - `zpages`: generate types that used in zPages. Currently only tracez related types will be generated. Currently supports `gen-tonic` or `gen-protoc`. |
| 18 | +//! |
| 19 | +//! ## Creates used to generate files |
11 | 20 | //! - `gen-tonic`: generate rs files using [tonic](https://github.com/hyperium/tonic) and [prost](https://github.com/tokio-rs/prost).
|
12 | 21 | //! - `gen-protoc`: generate rs files using [grpcio](https://github.com/tikv/grpc-rs).
|
13 |
| -//! - `traces`: generate types that used in traces. |
14 |
| -//! - `metrics`: generate types that used in metrics. |
15 |
| -//! - `zpages`: generate types that used in zPages. Currently only tracez related types will be generated. |
16 |
| -//! - `build-server`: build grpc service servers if enabled. Only applied to `gen-tonic`. |
17 |
| -//! - `build-client`: build grpc service clients if enabled. Only applied to `gen-tonic`. |
18 |
| -//! - `with-serde`: add serde annotations to generated types. Only applied to `gen-protoc`. |
| 22 | +//! |
| 23 | +//! ## Additional configurations |
| 24 | +//! - `build-server`: build grpc service servers if enabled. Only applicable to `gen-tonic`. |
| 25 | +//! - `build-client`: build grpc service clients if enabled. Only applicable to `gen-tonic`. |
| 26 | +//! - `with-serde`: add serde annotations to generated types. Only applicable to `gen-protoc`. |
| 27 | +//! |
| 28 | +//! ## Misc |
19 | 29 | //! - `full`: enabled all features above.
|
20 | 30 | //!
|
21 | 31 | //! By default, no feature is enabled.
|
22 | 32 |
|
23 | 33 | // proto mod contains file generated by protobuf or other build tools.
|
24 |
| -// we should manually change it. Thus skip format and lint check. |
| 34 | +// we shouldn't manually change it. Thus skip format and lint check. |
25 | 35 | #[rustfmt::skip]
|
26 | 36 | #[allow(warnings)]
|
27 | 37 | #[doc(hidden)]
|
28 | 38 | mod proto;
|
29 | 39 |
|
30 | 40 | #[cfg(feature = "gen-protoc")]
|
31 | 41 | pub use proto::grpcio;
|
| 42 | + |
32 | 43 | #[cfg(feature = "gen-tonic")]
|
33 | 44 | pub use proto::tonic;
|
34 | 45 |
|
|
0 commit comments