deadtrickster

deadtrickster

I’ve just released stable versions of my Prometheus Elixir libs:

Elixir client is based on Erlang client which exports dozens of metrics such as VM memory metrics, VM system info metrics, Mnesia metrics, etc.

For linux users there is also Process info collector.

I would be glad to answer any questions!

Showing Posts 1 to 10

skosch

skosch

For those new to monitoring (like myself), I wrote a blog post on how to set this up:

deadtrickster

deadtrickster OP

Thank you! Excellent post. Just a note: prometheus_plugs can also instrument a single plug or it’s own pipeline:

defmodule EnsureAuthenticatedInstrumenter do
  use Prometheus.PlugInstrumenter

  plug Guardian.Plug.EnsureAuthenticated

  def label_value(:authenticated, {conn, _}) do
    conn.status != 401
  end
end

Basically it uses Plug.Builder and similar to it in this aspect.

deadtrickster

deadtrickster OP

I just pushed version 3.0.1 of Prometheus.erl with huge performance update:

Run mix deps.update prometheus to update!

deadtrickster

deadtrickster OP

Update:

  • Prometheus.ex - mnesia contrib (e.g. calculate full space occupied by a table on disk);
  • Prometheus Plugs - content negotiation is turned on now. I.e. exporter should render text when request comes from browser and Protobuf when it comes from prometheus server. Format set to :auto by default.

I also have Slack channel (prometheus) now: Browser link.

deadtrickster

deadtrickster OP

New stuff:

deadtrickster

deadtrickster OP

Just released new version:

  • Boolean metric;
  • Text format rendering optimization (> 30% faster).

Github: GitHub - prometheus-erl/prometheus.ex: Prometheus.io Elixir client · GitHub
Hex.pm: prometheus_ex | Hex

tony612

tony612

Many thanks for your work. It’s very useful to have integrations with Prometheus. (Even if I haven’t used Elixir in production)

mmartinson

mmartinson

Thanks for your work on this. I found it pretty easy to get set up with and the docs were helpful. The pull-based model Prometheus uses is really great to get started easily sending metrics with a very small amount of overhead.

To people evaluating open source metrics solutions, would recommend based on my early experience.

MartinElvar

MartinElvar

This is really cool @deadtrickster, thank you! Are there any kind of guide i can follow, if i want to push my own metrics, which are more business oriented, like user signups etc. :slight_smile:

orestis

orestis

It’s all there in the README. For user signups, you probably want a counter. Lifting directly from the API docs, and doing some renaming:

defmodule UserSignupInstrumenter do

  use Prometheus.Metric

  ## to be called at app/supervisor startup.
  ## to tolerate restarts use declare.
  def setup() do
    Counter.declare([name: :my_service_user_signups_total,
                     help: "User signups count.",
                     labels: [:country]])
  end

  def inc(country) do
    Counter.inc([name: : my_service_user_signups_total,
                labels: [country]])
  end

end

Then from the places in your code where you handle user signups:

def handle_signup(user, other, stuff) do
  # create the user here
  country = MyGeoIPService.lookup_country(user)
  UserSignupInstrumenter.inc(country)
end

I made up a country label, so you can track user signups on a per-country basis. Not sure how useful it might be or not :slight_smile:

Where Next? Top

Trending in Announcing Top

restlessronin
The repo is at GitHub - cyberchitta/openai_ex: Community maintained Elixir library for OpenAI API · GitHub. Docs are at OpenaiEx User Gu...
152 12366 136
New
type1fool
WebAuthnLiveComponent WebAuthnComponents See this post about renaming the package. Passwordless authentication for Phoenix LiveView app...
New
mudasobwa
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
kip
In 2021 I started a new library called Tempo with the objective of modelling time as a set of intervals - not as instants. In 2022 I gave...
New
quatermain
Hello, I’m sharing my plugin here in forum after some time so it has time to mature and proof yourself. I use Claude Code daily on a pr...
New

Other Trending Topics Top

budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
juhalehtonen
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New
budgie
I love Elixir. It’s one of 2 programming languages I’ve ever fallen in love with. But I don’t use it anymore. Serverless was the promis...
New
OndrejValenta
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly) AI dream has many faces, but general...
New
Null-logic-0
What IDE or editor are you using for Elixir development? Personally, I use Zed, and I really like it, but sometimes I wish there were a ...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews