This repository was archived by the owner on Aug 30, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -68,14 +68,21 @@ class Config {
68
68
const auto baggageRestrictionsNode = configYAML[" baggage_restrictions" ];
69
69
const auto baggageRestrictions =
70
70
baggage::RestrictionsConfig::parse (baggageRestrictionsNode);
71
+
72
+ std::vector<Tag> tags;
73
+ const auto node = configYAML[" tags" ];
74
+ for (YAML::const_iterator it = node.begin (); it != node.end (); ++it) {
75
+ tags.emplace_back (it->first .as <std::string>(), it->second .as <std::string>());
76
+ }
77
+
71
78
return Config (disabled,
72
79
traceId128Bit,
73
80
sampler,
74
81
reporter,
75
82
headers,
76
83
baggageRestrictions,
77
84
serviceName,
78
- std::vector<Tag>() ,
85
+ tags ,
79
86
propagationFormat);
80
87
}
81
88
Original file line number Diff line number Diff line change @@ -107,6 +107,21 @@ propagation_format: w3c
107
107
}
108
108
}
109
109
110
+ TEST (Config, testTags)
111
+ {
112
+ {
113
+ constexpr auto kConfigYAML = R"cfg(
114
+ tags:
115
+ foo: bar
116
+ )cfg" ;
117
+ const auto config = Config::parse (YAML::Load (kConfigYAML ));
118
+
119
+ std::vector<Tag> expectedTags;
120
+ expectedTags.emplace_back (" foo" , std::string (" bar" ));
121
+ ASSERT_EQ (expectedTags, config.tags ());
122
+ }
123
+ }
124
+
110
125
#endif // JAEGERTRACING_WITH_YAML_CPP
111
126
112
127
TEST (Config, testFromEnv)
You can’t perform that action at this time.
0 commit comments