# Prometheus.jl release announcement

**URL:** <https://discourse.julialang.org/t/prometheus-jl-release-announcement/113005>\
**Category:** Package Announcements\
**Created:** [April 16, 2024, 11:47am UTC](https://discourse.julialang.org/t/prometheus-jl-release-announcement/113005 "2024-04-16T11:47:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [April 16, 2024, 11:47am UTC](https://discourse.julialang.org/t/prometheus-jl-release-announcement/113005/1 "2024-04-16T11:47:35Z")

</div>

I want to announce [Prometheus.jl](https://github.com/fredrikekre/Prometheus.jl) - a [Prometheus](https://prometheus.io/) client for Julia.

* * *

 ![image](https://global.discourse-cdn.com/julialang/original/3X/1/c/1c7c6bba121b30289b23b41b206a0fccb673c1af.png)  
_Metrics from eu-central package servers collected with Prometheus.jl, scraped by Prometheus and visualized with Grafana._

* * *

Prometheus is an open-source monitoring system used to track the performance of systems and services. Prometheus is a pull-based monitoring system which means that it requests metrics from the service. (Conversely, in push-based systems the service itself pushes metrics.) In particular this means that there has to be a client that can respond to the requests – this is what [Prometheus.jl](https://github.com/fredrikekre/Prometheus.jl) provides.

Prometheus documentation give detailed [guidelines for writing clients](https://prometheus.io/docs/instrumenting/writing_clientlibs/), so if you have used [any of the existing clients](https://prometheus.io/docs/instrumenting/clientlibs/) the Julia client should be familiar. All clients are built around the concept of _metrics_, _collectors_ and _collector registries_. A registry is basically a collection of collectors, and each collector provides one or more metrics. When responding to a metrics request the client exposes all metrics provided by all collectors in a given registry. The upstream Prometheus documentation describes this in more detail.

* * *

As of version 1.3.0 [Prometheus.jl](https://github.com/fredrikekre/Prometheus.jl) implements everything that the guideline expects from a client – and more! Some highlights:

- All four basic collectors ([`Counter`](https://fredrikekre.github.io/Prometheus.jl/v1/#Counter), [`Gauge`](https://fredrikekre.github.io/Prometheus.jl/v1/#Gauge), [`Summary`](https://fredrikekre.github.io/Prometheus.jl/v1/#Summary), and [`Histogram`](https://fredrikekre.github.io/Prometheus.jl/v1/#Histogram)) are available.
- A [`Family`](https://fredrikekre.github.io/Prometheus.jl/v1/#Labels) collector for metric/collector labeling.
- A [`ProcessCollector`](https://fredrikekre.github.io/Prometheus.jl/v1/#ProcessCollector) that provides metrics about a process (the Julia process by default) from the `/proc` filesystem.
- A [`GCCollector`](https://fredrikekre.github.io/Prometheus.jl/v1/#GCCollector) that provides allocation and GC metrics.
- Collector registries with associated functionality such as the ability to register and deregister collectors.
- A default collector registry where new collectors are registered by default (unless another registry is specified).
- Thread safety for modifying and accessing collectors.
- Metric exposition with gzip compression integrated with [HTTP.jl](https://github.com/JuliaWeb/HTTP.jl) (or any other IO stream).
- A [`Prometheus.@time`](https://fredrikekre.github.io/Prometheus.jl/v1/#Prometheus.@time) macro to measure the walltime of a code block and record it in an associated collector.
- A [`Prometheus.@inprogress`](https://fredrikekre.github.io/Prometheus.jl/v1/#Prometheus.@inprogress) macro that automatically increments/decrements a `Gauge` whenever entering/exiting a code block.

Please read the [documentation](https://fredrikekre.github.io/Prometheus.jl/) for more information and details.

* * *

I originally authored this package to help with package server maintenance and it has been used “in production” since late 2023, see [PkgServer.jl#196](https://github.com/JuliaPackaging/PkgServer.jl/pull/196) (this PR can also serve as an example for how to integrate [Prometheus.jl](https://github.com/fredrikekre/Prometheus.jl) into an existing code base). For the package servers the metrics are (currently) publicly visible so you can check them out if you visit [https://pkg.julialang.org/metrics](https://pkg.julialang.org/metrics).

Of course, the raw metrics are not very interesting to look at. How to configure Prometheus to scrape the metrics is very well documented in the [Prometheus docs](https://prometheus.io/docs/introduction/overview/), and how to configure Grafana to use Prometheus as a data source is very well documented in the [Grafana docs](https://grafana.com/docs/grafana/latest/). Once you configure this you can look at pretty graphs like the one in the beginning of the post!

* * *

If you have any feedback, please open an issue on the repository or post here.

Happy monitoring!

---

<div class="post-metadata">

**Author:** ![quinnj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/quinnj/32/11_2.png) [@quinnj](https://discourse.julialang.org/u/quinnj)\
**Post date:** [April 20, 2024, 12:56pm UTC](https://discourse.julialang.org/t/prometheus-jl-release-announcement/113005/2 "2024-04-20T12:56:44Z")

</div>

This is awesome; thanks @fredrikekre! I’ve wanted a solid prometheus implementation for a while!

---

<div class="post-metadata">

**Author:** ![svilupp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/svilupp/32/34933_2.png) [@svilupp](https://discourse.julialang.org/u/svilupp)\
**Post date:** [April 26, 2024, 6:27am UTC](https://discourse.julialang.org/t/prometheus-jl-release-announcement/113005/3 "2024-04-26T06:27:20Z")

</div>

This is amazing! Thank you!
