@@ -11,10 +11,6 @@ use url::Url;
11
11
12
12
use super :: ConfigurationSection ;
13
13
14
- fn sample_rate_example ( ) -> f64 {
15
- 0.5
16
- }
17
-
18
14
/// Propagation format for incoming and outgoing requests
19
15
#[ derive( Clone , Copy , Debug , Serialize , Deserialize , PartialEq , Eq , JsonSchema ) ]
20
16
#[ serde( rename_all = "lowercase" ) ]
@@ -70,7 +66,7 @@ pub struct TracingConfig {
70
66
///
71
67
/// Defaults to `1.0` if not set.
72
68
#[ serde( skip_serializing_if = "Option::is_none" ) ]
73
- #[ schemars( example = "sample_rate_example" , range( min = 0.0 , max = 1.0 ) ) ]
69
+ #[ schemars( example = 0.5 , range( min = 0.0 , max = 1.0 ) ) ]
74
70
pub sample_rate : Option < f64 > ,
75
71
}
76
72
@@ -123,41 +119,33 @@ impl MetricsConfig {
123
119
}
124
120
}
125
121
126
- fn sentry_dsn_example ( ) -> & ' static str {
127
- "https://public@host:port/1"
128
- }
129
-
130
- fn sentry_environment_example ( ) -> & ' static str {
131
- "production"
132
- }
133
-
134
122
/// Configuration related to the Sentry integration
135
123
#[ derive( Clone , Debug , Default , Serialize , Deserialize , JsonSchema ) ]
136
124
pub struct SentryConfig {
137
125
/// Sentry DSN
138
- #[ schemars( url, example = "sentry_dsn_example ") ]
126
+ #[ schemars( url, example = & "https://public@host:port/1 ") ]
139
127
#[ serde( skip_serializing_if = "Option::is_none" ) ]
140
128
pub dsn : Option < String > ,
141
129
142
130
/// Environment to use when sending events to Sentry
143
131
///
144
132
/// Defaults to `production` if not set.
145
- #[ schemars( example = "sentry_environment_example ") ]
133
+ #[ schemars( example = & "production ") ]
146
134
#[ serde( skip_serializing_if = "Option::is_none" ) ]
147
135
pub environment : Option < String > ,
148
136
149
137
/// Sample rate for event submissions
150
138
///
151
139
/// Defaults to `1.0` if not set.
152
140
#[ serde( skip_serializing_if = "Option::is_none" ) ]
153
- #[ schemars( example = "sample_rate_example" , range( min = 0.0 , max = 1.0 ) ) ]
141
+ #[ schemars( example = 0.5 , range( min = 0.0 , max = 1.0 ) ) ]
154
142
pub sample_rate : Option < f32 > ,
155
143
156
144
/// Sample rate for tracing transactions
157
145
///
158
146
/// Defaults to `0.0` if not set.
159
147
#[ serde( skip_serializing_if = "Option::is_none" ) ]
160
- #[ schemars( example = "sample_rate_example" , range( min = 0.0 , max = 1.0 ) ) ]
148
+ #[ schemars( example = 0.5 , range( min = 0.0 , max = 1.0 ) ) ]
161
149
pub traces_sample_rate : Option < f32 > ,
162
150
}
163
151
0 commit comments