@@ -90,7 +90,43 @@ pub enum Error {
90
90
/// }
91
91
/// ```
92
92
///
93
- /// ## Basic configuration
93
+ /// ## Pre-configured Tracing Instance
94
+ ///
95
+ /// There are two different styles to configure a [`Tracing`] instance: Using an opinionated pre-
96
+ /// configured instance or a fully customizable builder. The first option should be suited for
97
+ /// pretty much all operators by using sane defaults and applying best practices out-of-the-box.
98
+ /// [`Tracing::pre_configured`] lists details about environment variables, filter levels and
99
+ /// defaults used.
100
+ ///
101
+ /// ```
102
+ /// use stackable_telemetry::tracing::{Tracing, TelemetryOptions, Error};
103
+ ///
104
+ /// #[tokio::main]
105
+ /// async fn main() -> Result<(), Error> {
106
+ /// let options = TelemetryOptions {
107
+ /// no_console_output: false,
108
+ /// rolling_logs: None,
109
+ /// rolling_logs_period: None,
110
+ /// otlp_traces: true,
111
+ /// otlp_logs: true,
112
+ /// }
113
+ ///
114
+ /// let _tracing_guard = Tracing::pre_configured("test", options).init()?;
115
+ ///
116
+ /// tracing::info!("log a message");
117
+ ///
118
+ /// Ok(())
119
+ /// }
120
+ /// ```
121
+ ///
122
+ /// ## Builders
123
+ ///
124
+ /// When choosing the builder, there are two different styles to configure individual subscribers:
125
+ /// Using the sophisticated [`SettingsBuilder`] or the simplified tuple style for basic
126
+ /// configuration. Currently, three different subscribers are supported: console output, OTLP log
127
+ /// export, and OTLP trace export.
128
+ ///
129
+ /// ### Basic Configuration
94
130
///
95
131
/// A basic configuration of subscribers can be done by using 2-tuples or 3-tuples, also called
96
132
/// doubles and triples. Using tuples, the subscriber can be enabled/disabled and it's environment
@@ -120,7 +156,7 @@ pub enum Error {
120
156
/// }
121
157
/// ```
122
158
///
123
- /// ## Advanced configuration
159
+ /// ### Advanced Configuration
124
160
///
125
161
/// More advanced configurations can be done via the [`Settings::builder`] function. Each
126
162
/// subscriber provides specific settings based on a common set of options. These options can be
0 commit comments