Is there any plan for prometheus to support string type metrics

2,128 views
Skip to first unread message

Prashant Singh

unread,
Nov 1, 2022, 8:09:41 AM11/1/22
to Prometheus Users
Currently prometheus metrics types include counter, gauge, histogram, and summary. They are all numeric types. I would like to see if prometheus can support string type metric for exmplate sql qurey have output string or alphanumerics 

I am using sql_exporter agent for monitoring postgres db  qurey having output string based.


Thanks
Prashant Singh

Stuart Clark

unread,
Nov 1, 2022, 8:55:23 AM11/1/22
to Prashant Singh, Prometheus Users
On 2022-11-01 12:09, Prashant Singh wrote:
> Currently prometheus metrics types include counter, gauge, histogram,
> and summary. They are all numeric types. I would like to see if
> prometheus can support string type metric for exmplate SQL QUREY HAVE
> OUTPUT STRING OR ALPHANUMERICS
>
> I AM USING SQL_EXPORTER AGENT FOR MONITORING POSTGRES DB QUREY HAVING
> OUTPUT STRING BASED.
>

Prometheus is a metrics system, so everything is based on numeric data -
time series are collections of values representing the state at a
particular point in time.

It sounds like you are instead talking about events, which are very
different and not limited to number (e.g. logs).

Maybe it would be best to describe what you are trying to achieve?

--
Stuart Clark

Brian Candler

unread,
Nov 1, 2022, 12:38:35 PM11/1/22
to Prometheus Users
For something which stores events or arbitrary string values, I suggest you look at Loki or Elasticsearch.  Loki is modelled after Prometheus and has a PromQL-inspired query language.

It's possible to expose certain string values as labels in Prometheus.  However, these must be chosen from a limited set of possible values, because every time a label changes to a new value, it generates a new timeseries.  If you keep changing them you will get a "cardinality explosion" and Prometheus will crash and burn.
Reply all
Reply to author
Forward
0 new messages