mustela

mustela

Adding custom labels to all the metrics in PromEx

Hello everyone,

I hope you are all doing well. I’m seeking some guidance regarding an API that I plan to integrate with PromEX. This API is deployed for various customers, so we have customer1.api.com, http://customer2.api.com, etc. While the code remains identical, it is deployed in different environments but using the same prom/grafana instance. I would like to add custom labels to the metrics to filter them by customer, such as customer=customer1/2/3. Is there any way to do that easily?

Thank you in advance!

Marked As Solved

akoutmos

akoutmos

Author of Build a Weather Station with Elixir and Nerves

Depending on how many customers you have, I would caution you against adding a label for the customer as each unique customer label value increases the number of time series that you will be storing in Prometheus. It sounds like you also want to add this additional label to all of the PromEx metrics and that for sure will generate a lot of additional time series (see the Prometheus docs on this exact topic). If you are in Grafana Cloud, Grafana charges you per time series so you can expect your bill to sky rocket as well.

I would instead lean on your other observability tools to get specifics like customer/user/org/etc and keep prometheus for the high level metrics. If your metrics can surface that a particular endpoint is slow, it’ll be relatively slow for everyone.

Last Post!

mustela

mustela

Thank you @akoutmos ! You are right, it’s not a good idea. Ill explore other ways of doing it.

Where Next?

Popular in Questions Top

New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New

Other popular topics Top

hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

We're in Beta

About us Mission Statement