Skip to main content

mira_proto/
lib.rs

1//! OTLP wire types, generated at build time from the protos vendored under
2//! `proto/` (upstream opentelemetry-proto v1.9.0).
3//!
4//! We do not depend on the `opentelemetry-proto` crate: it declares
5//! `opentelemetry` and `opentelemetry_sdk` as non-optional dependencies (~12
6//! extra crates including a full SDK and `rand`), and its codegen does not
7//! enable `bytes = "bytes"`, so every trace_id would be a heap allocation.
8
9#![forbid(unsafe_code)]
10// Every doc comment under this crate root except the header above is a comment
11// from upstream's .proto files, reproduced verbatim by prost. Upstream writes
12// `<version>` and `<signal>` as prose placeholders, which rustdoc reads as
13// unclosed HTML. The fix belongs upstream; rewriting generated code in a build
14// script to satisfy a lint would be a worse thing than the lint. Scoped to this
15// crate only, so the same lints still bite on hand-written docs elsewhere.
16#![allow(rustdoc::invalid_html_tags)]
17
18pub mod common {
19    pub mod v1 {
20        include!(concat!(
21            env!("OUT_DIR"),
22            "/opentelemetry.proto.common.v1.rs"
23        ));
24    }
25}
26
27pub mod resource {
28    pub mod v1 {
29        include!(concat!(
30            env!("OUT_DIR"),
31            "/opentelemetry.proto.resource.v1.rs"
32        ));
33    }
34}
35
36pub mod logs {
37    pub mod v1 {
38        include!(concat!(env!("OUT_DIR"), "/opentelemetry.proto.logs.v1.rs"));
39    }
40}
41
42pub mod trace {
43    pub mod v1 {
44        include!(concat!(env!("OUT_DIR"), "/opentelemetry.proto.trace.v1.rs"));
45    }
46}
47
48pub mod metrics {
49    pub mod v1 {
50        include!(concat!(
51            env!("OUT_DIR"),
52            "/opentelemetry.proto.metrics.v1.rs"
53        ));
54    }
55}
56
57pub mod collector {
58    pub mod logs {
59        pub mod v1 {
60            include!(concat!(
61                env!("OUT_DIR"),
62                "/opentelemetry.proto.collector.logs.v1.rs"
63            ));
64        }
65    }
66    pub mod trace {
67        pub mod v1 {
68            include!(concat!(
69                env!("OUT_DIR"),
70                "/opentelemetry.proto.collector.trace.v1.rs"
71            ));
72        }
73    }
74    pub mod metrics {
75        pub mod v1 {
76            include!(concat!(
77                env!("OUT_DIR"),
78                "/opentelemetry.proto.collector.metrics.v1.rs"
79            ));
80        }
81    }
82}