Skip to content

Commit fd955bc

Browse files
ref(globconfig): Set empty global config (#2395)
1 parent e835f4f commit fd955bc

File tree

1 file changed

+1
-50
lines changed

1 file changed

+1
-50
lines changed

relay-dynamic-config/src/global.rs

Lines changed: 1 addition & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,9 @@
1-
use relay_general::store::MeasurementsConfig;
21
use serde::{Deserialize, Serialize};
32

4-
use crate::TaggingRule;
5-
63
/// A dynamic configuration for all Relays passed down from Sentry.
74
///
85
/// Values shared across all projects may also be included here, to keep
96
/// [`ProjectConfig`](crate::ProjectConfig)s small.
107
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
118
#[serde(default, rename_all = "camelCase")]
12-
pub struct GlobalConfig {
13-
/// Project configuration for measurements.
14-
#[serde(skip_serializing_if = "Option::is_none")]
15-
measurements: Option<MeasurementsConfig>,
16-
/// Project configuration for rules for applying metrics tags depending on
17-
/// the event's content.
18-
#[serde(skip_serializing_if = "Option::is_none")]
19-
metric_conditional_tagging: Option<Vec<TaggingRule>>,
20-
}
21-
22-
#[cfg(test)]
23-
mod tests {
24-
use crate::GlobalConfig;
25-
26-
#[test]
27-
fn test_global_config_roundtrip() {
28-
let json = r#"{
29-
"measurements": {
30-
"builtinMeasurements": [
31-
{
32-
"name": "plate.size",
33-
"unit": "5"
34-
}
35-
],
36-
"maxCustomMeasurements": 2
37-
},
38-
"metricConditionalTagging": [
39-
{
40-
"condition": {
41-
"op": "gt",
42-
"name": "food.deliciousness",
43-
"value": 8
44-
},
45-
"targetMetrics": [
46-
"tummy.satisfaction"
47-
],
48-
"targetTag": "satisfied",
49-
"tagValue": "hellyeah"
50-
}
51-
]
52-
}"#;
53-
54-
let deserialized: GlobalConfig = serde_json::from_str(json).unwrap();
55-
let reserialized = serde_json::to_string_pretty(&deserialized).unwrap();
56-
assert_eq!(json, reserialized);
57-
}
58-
}
9+
pub struct GlobalConfig {}

0 commit comments

Comments
 (0)