[PATCH] gnu: Add guile-prometheus.

  • Done
  • quality assurance status badge
Details
2 participants
  • Christopher Baines
  • Mathieu Othacehe
Owner
unassigned
Submitted by
Christopher Baines
Severity
normal

Debbugs page

Christopher Baines wrote 5 years ago
(address . guix-patches@gnu.org)
20200906120744.20651-1-mail@cbaines.net
* gnu/packages/guile-xyz.scm (guile-prometheus): New variable.
---
gnu/packages/guile-xyz.scm | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)

Toggle diff (43 lines)
diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index fa6855f43d..532a8008e5 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -853,6 +853,36 @@ Vicare Scheme and IronScheme. Right now it contains:
@end itemize\n")
(license license:bsd-3)))
+(define-public guile-prometheus
+ (let ((commit "cbc6e1b03512443a03d66414c426adb8470b5f2b")
+ (revision "0"))
+ (package
+ (name "guile-prometheus")
+ (version (string-append "0-" revision "." (string-take commit 7)))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://git.cbaines.net/git/guile/prometheus")
+ (commit commit)))
+ (sha256
+ (base32
+ "1k1qg4ia87w2ipnf8cpikdc67lxi5bmahkhgk2x0i9ibdyvqb7np"))
+ (file-name (string-append name "-" version "-checkout"))))
+ (build-system gnu-build-system)
+ (native-inputs
+ `(("pkg-config" ,pkg-config)
+ ("autoconf" ,autoconf)
+ ("automake" ,automake)))
+ (inputs
+ `(("guile" ,guile-3.0)))
+ (home-page "https://git.cbaines.net/guile/prometheus")
+ (synopsis "Prometheus client library for Guile")
+ (description
+ "This Guile library provides instrumentation code intended to be used
+with the Prometheus time series service. Counter, gauge and histogram metric
+types are supported.")
+ (license license:gpl3+))))
+
(define-public guile2.2-pfds
(package
(inherit guile-pfds)
--
2.28.0
Mathieu Othacehe wrote 5 years ago
(name . Christopher Baines)(address . mail@cbaines.net)(address . 43239@debbugs.gnu.org)
874kobxceq.fsf@gnu.org
Hello Christopher,

Toggle quote (3 lines)
> + (name "guile-prometheus")
> + (version (string-append "0-" revision "." (string-take commit 7)))

I think that the usual pattern is something like:

Toggle snippet (3 lines)
(version (git-version "0.0.1" revision commit))

Toggle quote (4 lines)
> + (inputs
> + `(("guile" ,guile-3.0)))
> + (home-page "https://git.cbaines.net/guile/prometheus")

The linter reports that this URL is not reachable.

Toggle quote (7 lines)
> + (synopsis "Prometheus client library for Guile")
> + (description
> + "This Guile library provides instrumentation code intended to be used
> +with the Prometheus time series service. Counter, gauge and histogram metric
> +types are supported.")
> + (license license:gpl3+))))

Otherwise, looks fine! Turns out I'm currently working on adding some
metrics to Cuirass[1]. With commit 154232b, we should be able to add the
two metrics proposed in the bug report. The next step is to actually
compute, save and display those metrics.

I'm just discovering this prometheus but may it could be a good
candidate? Do you happen to have a server running prometheus?

Thanks,

Mathieu

Christopher Baines wrote 5 years ago
(name . Mathieu Othacehe)(address . othacehe@gnu.org)(address . 43239-done@debbugs.gnu.org)
874koan4ok.fsf@cbaines.net
Mathieu Othacehe <othacehe@gnu.org> writes:

Toggle quote (11 lines)
> Hello Christopher,
>
>> + (name "guile-prometheus")
>> + (version (string-append "0-" revision "." (string-take commit 7)))
>
> I think that the usual pattern is something like:
>
> --8<---------------cut here---------------start------------->8---
> (version (git-version "0.0.1" revision commit))
> --8<---------------cut here---------------end--------------->8---

Ah, yeah, I copied from a package definition not using that.

Toggle quote (6 lines)
>> + (inputs
>> + `(("guile" ,guile-3.0)))
>> + (home-page "https://git.cbaines.net/guile/prometheus")
>
> The linter reports that this URL is not reachable.

I think it's actually the source URL (with the /git bit in it ) that it
complains about:

gnu/packages/guile-xyz.scm:862:12: guile-prometheus@0-0.cbc6e1b: URI https://git.cbaines.net/git/guile/prometheusnot reachable: 404 ("Not Found")

While the home page URL definitely works, that URL does 404, however it
seems to work just fine for cloning the repository, so I'm not quite
sure what if anything to do with this lint warning.

Toggle quote (15 lines)
>> + (synopsis "Prometheus client library for Guile")
>> + (description
>> + "This Guile library provides instrumentation code intended to be used
>> +with the Prometheus time series service. Counter, gauge and histogram metric
>> +types are supported.")
>> + (license license:gpl3+))))
>
> Otherwise, looks fine! Turns out I'm currently working on adding some
> metrics to Cuirass[1]. With commit 154232b, we should be able to add the
> two metrics proposed in the bug report. The next step is to actually
> compute, save and display those metrics.
>
> I'm just discovering this prometheus but may it could be a good
> candidate? Do you happen to have a server running prometheus?

I've with the version change, I've gone ahead and pushed. Thanks for
taking a look!

As for Cuirass metrics, that sounds exciting. I do happen to have a
Prometheus instance [1] which I've been using to monitor machines and
the Guix Build Coordinator that I run for the guix.cbaines.net build
farm.


While Prometheus can generate graphs, I've been using Grafana [2] to
build dashboards to visualise the Prometheus data.


This [4] is the dashboard I have for the guix.cbaines.net stuff, which
pulls together data from the node exporter service on the various
machines as well as the Guix Build Coordinator coordinator service
itself [5].


Today, I've just started getting the Guix Data Service to export some
metrics [6] as I want to try and understand how the size of different
tables and indexes in the database change over time. There's a Grafana
dashboard for that too [7].


Additionally, I'm also running Alertmanager [8] which can send out
emails, for example when a machine is low on disk space.


Anyway, if you decide to have Cuirass export metrics in the Prometheus
style, just let me know and I can get the Prometheus instance I'm
running to scrape them. I can also give you access to Grafana so you can
create dashboards.

Thanks again,

Chris
-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAl9VKYtfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE
9XdK/w/8Dv9rPnHBbf1EmbRtLE9tH3TG57PW5uRLjEhUcqkNyWf+MRUFPwyMaG7w
/nOLsQ05J7diaywvkZlbZ4jTZ9qB1B2hGfrhOAgEMzKawMz1TmiyTLQiWAWzGmPg
02PCBta7/v/8fPfszK4GWdUHwjtzDd7OunCnuK8fEbiTOWgWe2lPpc95dogQcmvr
wYAApqibtv7HvlIOGPN7ICQV1NISgbg+OMbsJ/v9fYorGfGnK82q/YbP3Tz8X6OH
rtUh+wOkCfby2Uxe6ExX2ST6gnrZ8AAvN4VvDIn3SW8w75StICqraYHsE36ooQN0
kwSKcnLTHFgIM+MxeUxyoED97ZsP/q5Ycw7un8b3qw9ajVp6J3OvX295RixMEvC/
gQsaSdGFR5osHdpOQ+GNwNqr3y11a84HkTofHK0afybqpWZYSl6udxbSEnj31AUU
TDNwAJFBZKcTn3U10kb+nQmyZjftMUW468kIrv8uaQ1YvcuaVLNkP2xJYlOurFT/
t6K3a+BdS8b+gcNsJKR//RaK42b0hnDMg54o0GOmYv6kHpAA0AUaKWke9LWmP4sV
Haoy8tPsR7YlHrJG2vpcMOPATFAQJmUJWQLtUV4JLZ7WnSZ/WlHDYLsaqj6zjkQf
cCP5lKiKTQD0LaBdW7k92uTqbaKEhxbhDPY2Bi4KGr3Fs3CQgCQ=
=Y1GR
-----END PGP SIGNATURE-----

Closed
Mathieu Othacehe wrote 5 years ago
(name . Christopher Baines)(address . mail@cbaines.net)(address . 43239-done@debbugs.gnu.org)
87r1r94vfn.fsf@gnu.org
Hello Chris,

Toggle quote (5 lines)
> Anyway, if you decide to have Cuirass export metrics in the Prometheus
> style, just let me know and I can get the Prometheus instance I'm
> running to scrape them. I can also give you access to Grafana so you can
> create dashboards.

Thanks a lot for all the inputs. For now I've decided to store metrics
in a dedicated Cuirass table. Then, I'll display some of them directly
in the web UI while making other available through the JSON API.

I'll see in a second time if I can also export those metrics to your
Prometheus servers.

Mathieu
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 43239@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 43239
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help