@@ -124,14 +124,26 @@ std::string TracerTelemetry::heartbeat_and_telemetry() {
124124 auto & metric = m.first .get ();
125125 auto & points = m.second ;
126126 if (!points.empty ()) {
127- metrics.emplace_back (nlohmann::json::object ({
128- {" metric" , metric.name ()},
129- {" tags" , metric.tags ()},
130- {" type" , metric.type ()},
131- {" interval" , 60 },
132- {" points" , points},
133- {" common" , metric.common ()},
134- }));
127+ auto type = metric.type ();
128+ if (type == " count" ) {
129+ metrics.emplace_back (nlohmann::json::object ({
130+ {" metric" , metric.name ()},
131+ {" tags" , metric.tags ()},
132+ {" type" , metric.type ()},
133+ {" points" , points},
134+ {" common" , metric.common ()},
135+ }));
136+ } else if (type == " gauge" ) {
137+ // gauge metrics have a interval
138+ metrics.emplace_back (nlohmann::json::object ({
139+ {" metric" , metric.name ()},
140+ {" tags" , metric.tags ()},
141+ {" type" , metric.type ()},
142+ {" interval" , 10 },
143+ {" points" , points},
144+ {" common" , metric.common ()},
145+ }));
146+ }
135147 }
136148 points.clear ();
137149 }
0 commit comments