@@ -178,14 +178,26 @@ std::string TracerTelemetry::app_closing() {
178178 auto & metric = m.first .get ();
179179 auto & points = m.second ;
180180 if (!points.empty ()) {
181- metrics.emplace_back (nlohmann::json::object ({
182- {" metric" , metric.name ()},
183- {" tags" , metric.tags ()},
184- {" type" , metric.type ()},
185- {" interval" , 60 },
186- {" points" , points},
187- {" common" , metric.common ()},
188- }));
181+ auto type = metric.type ();
182+ if (type == " count" ) {
183+ metrics.emplace_back (nlohmann::json::object ({
184+ {" metric" , metric.name ()},
185+ {" tags" , metric.tags ()},
186+ {" type" , metric.type ()},
187+ {" points" , points},
188+ {" common" , metric.common ()},
189+ }));
190+ } else if (type == " gauge" ) {
191+ // gauge metrics have a interval
192+ metrics.emplace_back (nlohmann::json::object ({
193+ {" metric" , metric.name ()},
194+ {" tags" , metric.tags ()},
195+ {" type" , metric.type ()},
196+ {" interval" , 10 },
197+ {" points" , points},
198+ {" common" , metric.common ()},
199+ }));
200+ }
189201 }
190202 points.clear ();
191203 }
0 commit comments