You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It'd be nice to have a type class for labels such that I could define in my app how a certain domain-specific value got translated to a Prometheus label.
e.g.
classToLabelawheretoLabel::a->StringdataMyStatus=Good | Bad | IndifferentinstanceToLabelMyStatuswhere
toLabel Good="good"
toLabel Bad="bad"
toLabel Indifferent="indifferent"
withLabel Good incCounter someMetric
But then, as I write this, I realise this probably devolves into wanting extensible records such that you can declare the type of a label at metric creation and have the type system make sure you've go the right value in the right place, which is probably going overboard.
The text was updated successfully, but these errors were encountered:
ocharles@70b0759 is my take on what a Label class could look like.
It doesn't let you have "anonymous" labels, everything must be statically declared up front. Given the benefit of actually have much more explicit label assignment, I think it's worth it.
It'd be nice to have a type class for labels such that I could define in my app how a certain domain-specific value got translated to a Prometheus label.
e.g.
But then, as I write this, I realise this probably devolves into wanting extensible records such that you can declare the type of a label at metric creation and have the type system make sure you've go the right value in the right place, which is probably going overboard.
The text was updated successfully, but these errors were encountered: