bitnomial / prometheus Goto Github PK
View Code? Open in Web Editor NEWPrometheus.io Haskell client.
Home Page: https://hackage.haskell.org/package/prometheus
License: BSD 3-Clause "New" or "Revised" License
Prometheus.io Haskell client.
Home Page: https://hackage.haskell.org/package/prometheus
License: BSD 3-Clause "New" or "Revised" License
Currently using Prometheus Gauges to log a Word64
using fromIntegral
and it gets reported as:
db_slot_height 2.3628703e7
This is a little suboptimal.
Would it be worth adding a Word64
gauge? If you can point me in the direction of what you want, I may even find time to do it myself.
Could we get the base build dep bumped?
The prometheus
package is currently not in Stackage. Please consider adding it. It is recommended that the package author maintains the Stackage listing, but if you have no interest in maintaining the Stackage listing, I can volunteer to do so on your behalf.
I was looking into Prometheus libraries and was attracted to this one by its type safety and restricted use of IO.
However, I can't figure out how to set labels at the point of observation, which is a particularly common use case. e.g. I'd like to record the method & status code of HTTP requests & responses alongside their latency.
This is something of a blocker for me. Are you open to accepting patches?
Here in git you have:
, text >= 1.2 && < 2.1
but the version on Hackage has:
text >=1.2 && <1.3,
This can be fixed by a metadata update on Hackage.
I am currently using:
allow-newer: prometheus:text
in my cabal.project
file
How do you want to handle name and label validation, mentioned in the README as a wanted feature? I think the easiest option is to replace invalid characters. It's probably possible to make them a compile-time failure instead, but I think not worth it. If that's the approach you want, I can put together a PR to bring https://github.com/Simspace/ekg-prometheus-adapter/commit/704078488730b7e87eaa95ee3bbe3b2ad6cf1cf8 into this package.
The latest version in git has a cabal file that says its version 2.1.0 (and which supports containers == 0.6.*
), but the latest version on Hackage is 2.1.1 which does not support containers == 0.5.*
.
https://matrix.hackage.haskell.org/package/prometheus#GHC-8.2/prometheus-2.0.0
Data.Semigroup (Semigroup)
needs to be imported.
Current HEAD
has more relaxed upper version bounds on bytestring
, containers
and transformers
If that can be fixed with a Hackage metadata revision then that would also be fine.
In my cabal.project
file I currently have;
allow-newer:
, prometheus:text
if impl(ghc >= 9.6)
allow-newer:
, prometheus:bytestring
, prometheus:containers
, prometheus:transformers
and this module is mentioned in the example in the .cabal file and README.
Is there a solution for persisting metrics here? Is it needed? Specifically - if I restart my metrics server, how will that affect my counters? It seems they would be wiped.
Illustrated by this ghci session: https://gist.github.com/ramirez7/591582438c34f6eac9c0b11ca95d086f
HistogramSample
just needs some strictness annotations I believe.
New versions of http-client have been released that are compatible
with prometheus. Can the version bounds be widened to include these
new versions of http-client?
, http-client >= 0.4 && < 0.7
Should be sufficient.
Hi, I was comparing this library to prometheus-client
and other prometheus libraries. One drawback, as far as I can tell from the API docs, is that all label values must be specified up-front. Is this correct? The documentation gives this as an example, which gives "success" or "failure" for the possible label values:
main :: IO ()
main = runRegistryT $ do
-- Labels can be defined as lists or added to an empty label set
connectSuccessGauge <- registerGauge "example_connections" (fromList [("login", "success")])
connectFailureGauge <- registerGauge "example_connections" (addLabel "login" "failure" mempty)
This seems somewhat inflexible. For example, the Prometheus docs suggest having an http_requests_total
with a label for the status code (https://prometheus.io/docs/practices/instrumentation/#use-labels). If you had to specify the status code up front, it seems like you'd have to auto-create values for 100โ599, which isn't ideal.
Other libraries don't have this restriction, e.g. https://github.com/prometheus/client_ruby#summary, for comparison
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.