1#![deny(warnings)]
7#![deny(clippy::all)]
8#![deny(clippy::pedantic)]
9#![deny(unreachable_pub)]
10#![deny(unused_allocation)]
11#![deny(unused_extern_crates)]
12#![deny(unused_assignments)]
13#![deny(unused_comparisons)]
14
15pub use vector_common_macros::NamedInternalEvent;
16
17#[cfg(feature = "btreemap")]
18pub use vrl::btreemap;
19
20#[cfg(feature = "byte_size_of")]
21pub mod byte_size_of;
22
23pub mod json_size;
24
25pub mod config;
26
27pub mod constants;
28
29#[cfg(feature = "conversion")]
30pub use vrl::compiler::TimeZone;
31
32#[cfg(feature = "encoding")]
33pub mod encode_logfmt {
34 pub use vrl::core::encode_logfmt::*;
35}
36
37pub mod conversion {
38 pub use vrl::compiler::conversion::*;
39}
40
41pub mod event_data_eq;
42pub use event_data_eq::EventDataEq;
43
44#[cfg(any(test, feature = "test"))]
45pub mod event_test_util;
46
47pub mod finalization;
48pub mod finalizer;
49pub use finalizer::EmptyStream;
50
51pub mod id;
52
53pub mod internal_event;
54
55pub mod request_metadata;
56
57pub mod shutdown;
58
59#[cfg(feature = "sensitive_string")]
60pub mod sensitive_string;
61
62pub mod atomic;
63pub mod compression;
64pub mod stats;
65pub mod trigger;
66
67#[macro_use]
68extern crate tracing;
69
70#[macro_export]
72macro_rules! counter {
73 ($name:expr) => {{
74 let _name: $crate::internal_event::CounterName = $name;
75 #[allow(clippy::disallowed_macros)]
76 {
77 metrics::counter!(_name.as_str())
78 }
79 }};
80 ($name:expr, $($rest:tt)*) => {{
81 let _name: $crate::internal_event::CounterName = $name;
82 #[allow(clippy::disallowed_macros)]
83 {
84 metrics::counter!(_name.as_str(), $($rest)*)
85 }
86 }};
87}
88
89#[macro_export]
91macro_rules! histogram {
92 ($name:expr) => {{
93 let _name: $crate::internal_event::HistogramName = $name;
94 #[allow(clippy::disallowed_macros)]
95 {
96 metrics::histogram!(_name.as_str())
97 }
98 }};
99 ($name:expr, $($rest:tt)*) => {{
100 let _name: $crate::internal_event::HistogramName = $name;
101 #[allow(clippy::disallowed_macros)]
102 {
103 metrics::histogram!(_name.as_str(), $($rest)*)
104 }
105 }};
106}
107
108#[macro_export]
110macro_rules! gauge {
111 ($name:expr) => {{
112 let _name: $crate::internal_event::GaugeName = $name;
113 #[allow(clippy::disallowed_macros)]
114 {
115 metrics::gauge!(_name.as_str())
116 }
117 }};
118 ($name:expr, $($rest:tt)*) => {{
119 let _name: $crate::internal_event::GaugeName = $name;
120 #[allow(clippy::disallowed_macros)]
121 {
122 metrics::gauge!(_name.as_str(), $($rest)*)
123 }
124 }};
125}
126
127pub type Error = Box<dyn std::error::Error + Send + Sync + 'static>;
130
131pub type Result<T> = std::result::Result<T, Error>;
134
135#[track_caller]
141pub fn spawn_in_current_span<T>(
142 task: impl std::future::Future<Output = T> + Send + 'static,
143) -> tokio::task::JoinHandle<T>
144where
145 T: Send + 'static,
146{
147 use tracing::Instrument as _;
148 tokio::spawn(task.in_current_span())
149}