KUDU-3549 fix WriteAsPrometheus() for non-arithmetic gauges

This patch fixes WriteAsPrometheus() implementation for string-based
gauges.  The original changelist that introduced Prometheus metrics
had a proper implementation of WriteAsPrometheus() only for StringGauge,
but any FunctionGauge for a non-arithmetic type (e.g., for std::string)
would still output a string value in Prometheus text format, and that
could not be consumed by Prometheus.  The patch also contains a test
scenario that would fail without the fix.

This is a follow-up to 00efc6826ac9a1f5d10750296c7357790a041fec.

Change-Id: Ib7128f52729c7f984004811153a7eecc8ffe751b
Reviewed-on: http://gerrit.cloudera.org:8080/20990
Tested-by: Alexey Serbin <alexey@apache.org>
Reviewed-by: Marton Greber <greber.mx@gmail.com>
Reviewed-by: Attila Bukor <abukor@apache.org>
3 files changed