prometheus-client v1.0.1 Release Notes
Release Date: 2020-01-25 // over 3 years ago-
No data yet ๐
You can check the official repo
Previous changes from v1.0.0
-
๐ Version 1.0.0 is a significant rewrite of some core parts of the API, as
prometheus-effect
has been deprecated in favour of this library.๐ฅ Breaking Changes
๐ New Metric API
๐ The most substatial change regards the
Metric
interface. Unregistered counters are now wrapped in theMetric
type (as before), but when registered, theMetric
wrapper is removed. This change means that registered metrics are more lightweight (they are often just a newtype wrapper), but also helps users
distinguish between registered and unregistered metrics.To adapt to this change, users should:
Store and pass registered metrics. Rather than passing
Metric Counter
, preferregister
ing to obtain aCounter
and pass that around.Top level registrations will no longer return
Metric
. If you havehttpRequests :: Metric CounterhttpRequests = unsafeRegisterIO $ counter (Info ...)
This should change to
httpRequests :: CounterhttpRequests = unsafeRegister $ counter (Info ...)
Other Breaking Changes
๐
Prometheus.exportMetricsAsText
now returns a lazyByteString
rather than a strictByteString
. This provides better streaming performance, and the underlyingByteString
is built using aBuilder
for improved performance. You can convert the lazyByteString
into a strict one usingData.ByteString.Lazy.toStrict
, but you should consider taking advantage of the lazy interface if possible.Prometheus.Info
now usesText
instead ofString
. It is recommended that you use theOverloadedStrings
extension.๐ The label interface has been changed to only support tuples of
Text
. The tuple instances prevent any other tuple instances from being defined. This interface is in flux and may change again in the future. For now,OverloadedStrings
will give you compatibility with the old interface.Backwards Compatible Changes
- Many functions that were specialised to
IO
have been generalised to work inMonadIO
.
โ Additions
Prometheus.countExceptions
to count the amount of exceptions a given monadic action throws.
- Many functions that were specialised to