Closed
Description
Under Windows, each line of metrics sent from WebLogic Monitoring Exporter is ended with \n\r (line feed, carriage return) The Carriage return (\r) character is not expected by Prometheus when it parses each metrics line and then raise an exception.
This issue can be solved with an update of methods printMetric() and printPerformanceMetrics() from the io.prometheus.wls.rest.MetricsStream class.
Here is a correction proposal :
void printMetric(String name, Object value) {
//println(name + " " + value);
printf( "%s %s\n", name, value);
scrapeCount++;
}
/**
* Prints the summary performance metrics
*/
void printPerformanceMetrics() {
//printf( "%s %d%n", getCountName(), scrapeCount);
//printf("%s %.2f%n", getDurationName(), toSeconds(getElapsedTime()));
//printf("%s %.2f%n", getCpuUsageName(), toSeconds(getCpuUsed()));
printf( "%s %d\n", getCountName(), scrapeCount);
printf("%s %.2f\n", getDurationName(), toSeconds(getElapsedTime()));
printf("%s %.2f\n", getCpuUsageName(), toSeconds(getCpuUsed()));
}
Metadata
Metadata
Assignees
Labels
No labels