Hi,
I am wondering what the difference is between having a small set of metric names and differentiate using labels and differentiating based on name with fewer labels.
Suppose I have
- services A,B,C,D,E,....
- components in these services, eg. "DB" , "QUEUE","FTP","ODBC", representing connections to upstream systems
- a list of errors possibly occurring when interacting with these upstreams (TIMEOUT, LOGIN_FAILED, UNKNOWN_HOST"...)
Now, I could create metrics names like these (many names, no labels):
A_QUEUE_TIMEOUT_COUNTER
...
F_ODBC_UNKNOWN_HOST_COUNTER
But I could also create names like these (few names, many labels)
TIMEOUT_COUNTER{service=A,component=DB}
In my understanding, in the many-names-few-labels case, I am loosing the ability to efficiently aggregate, eg all timeouts. Is that correct?
On the other hand, I would prefer the later variant, with a few names and using labels for variations to be prepared for a diversity of aggregations / views.
My question: is the a performance or other impact of having few metrics with lots of labels?
How can I determine the tipping point? IOW, how do I know I am using too many labels and should rather vary on names?
Or does it make no difference whatsoever, because inside prometheus any unqiue combination becomes an equally significant time series anyhow?
(I understand that having unbounded number of labels is a problem - that is however not the issue - the eventual amount of combinations would be exactly the same in my case, either way)
Jan