File tree Expand file tree Collapse file tree 2 files changed +4
-19
lines changed Expand file tree Collapse file tree 2 files changed +4
-19
lines changed Original file line number Diff line number Diff line change @@ -61,24 +61,6 @@ impl Drop for OtelGuard {
61
61
}
62
62
}
63
63
64
- /// Otlp parse error.
65
- #[ derive( Debug , Clone , PartialEq , Eq ) ]
66
- pub struct OtlpParseError ( String ) ;
67
-
68
- impl From < String > for OtlpParseError {
69
- fn from ( s : String ) -> Self {
70
- Self ( s)
71
- }
72
- }
73
-
74
- impl core:: fmt:: Display for OtlpParseError {
75
- fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
76
- f. write_str ( & format ! ( "invalid OTLP protocol: {}" , self . 0 ) )
77
- }
78
- }
79
-
80
- impl core:: error:: Error for OtlpParseError { }
81
-
82
64
/// Otel configuration. This struct is intended to be loaded from the env vars
83
65
///
84
66
/// The env vars it checks are:
@@ -139,7 +121,7 @@ impl FromEnv for OtelConfig {
139
121
140
122
fn from_env ( ) -> Result < Self , FromEnvErr < Self :: Error > > {
141
123
// load endpoint from env. ignore empty values (shortcut return None), parse, and print the error if any using inspect_err
142
- let endpoint = Url :: from_env_var ( OTEL_ENDPOINT ) . inspect_err ( |e| eprintln ! ( "{e}" ) ) ?;
124
+ let endpoint = Url :: from_env_var ( OTEL_ENDPOINT ) ?;
143
125
144
126
let level = tracing:: Level :: from_env_var ( OTEL_LEVEL ) . unwrap_or ( tracing:: Level :: DEBUG ) ;
145
127
Original file line number Diff line number Diff line change @@ -56,6 +56,9 @@ pub fn init_tracing() -> Option<OtelGuard> {
56
56
Some ( guard)
57
57
} else {
58
58
install_fmt ! ( registry) ;
59
+ tracing:: debug!(
60
+ "No OTEL config found or error while loading otel config, using default tracing"
61
+ ) ;
59
62
None
60
63
}
61
64
}
You can’t perform that action at this time.
0 commit comments