File tree Expand file tree Collapse file tree
inc/drogon/utils/monitoring Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ class Gauge : public Metric
9191
9292 static std::string_view type ()
9393 {
94- return " counter " ;
94+ return " gauge " ;
9595 }
9696
9797 void setToCurrentTime ()
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ void PromExporter::initAndStart(const Json::Value &config)
2828 }
2929 auto resp = HttpResponse::newHttpResponse ();
3030 resp->setBody (thisPtr->exportMetrics ());
31+ resp->setContentTypeCode (CT_TEXT_PLAIN);
3132 resp->setExpiredTime (5 );
3233 callback (resp);
3334 },
@@ -118,12 +119,12 @@ static std::string exportCollector(
118119 .append (collector->name ())
119120 .append (" " )
120121 .append (collector->help ())
121- .append (" \r\ n " );
122+ .append (" \n " );
122123 res.append (" # TYPE " )
123124 .append (collector->name ())
124125 .append (" " )
125126 .append (collector->type ())
126- .append (" \r\ n " );
127+ .append (" \n " );
127128 for (auto const &sampleGroup : sampleGroups)
128129 {
129130 auto const &metricPtr = sampleGroup.metric ;
@@ -157,11 +158,11 @@ static std::string exportCollector(
157158 res.append (" " )
158159 .append (std::to_string (
159160 sample.timestamp .microSecondsSinceEpoch () / 1000 ))
160- .append (" \r\ n " );
161+ .append (" \n " );
161162 }
162163 else
163164 {
164- res.append (" \r\ n " );
165+ res.append (" \n " );
165166 }
166167 }
167168 }
You can’t perform that action at this time.
0 commit comments