mat-hek

mat-hek

Membrane Core Team

Aggregating telemetry metrics for each dynamically spawned job

Hi there,

we’re playing with the telemetry library, using telemetry-metrics to specify metrics. Our use case is that we dynamically spawn jobs that are usually running for a while and terminate once their work is done. We’d like to collect metrics from these jobs, such as bytes processed, chunks of data processed, and the number of occurrences of certain events. The information we’d like telemetry to give us is this data aggregated per job. To achieve that, we’re currently using the :job_id tag. The problem is, I don’t see a possibility to tell telemetry that a job terminated and it should forget the given tag value. Because of that, libraries like telemetry_metrics_prometheus report that value forever, which leads to a mem leak and growing overhead when we have thousands of jobs being spawned and terminated. According to the answer to this issue, Prometheus is not suitable for aggregating this kind of data, but it seems to me that it’s rather a limitation of telemetry itself. We can try using OpenTelemetry instead, but AFAIK it’s more about traces and metrics are still in alpha, while we need metrics in the first place.

I believe there must be a correct way of approaching this problem. Any suggestions appreciated :wink:

Most Liked

RudManusachi

RudManusachi

I don’t have an answer, but wanted to share that in the past I faced the same issue with assigning unique tags to metrics (very high cardinality). We were using DataDog and eventually we got notified from their support that if we continue that way our bills would become enormous. And were suggested to stop using metrics for those types of tags and switch to APM traces where they provide with “infinite-cardinality” attributes.

Where Next?

Popular in Questions Top

jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? https://hexdocs.pm/ecto/Ecto.Repo.h...
New
johnnyicon
Hi all, I've just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I'm trying to use Postg...
New
sabri
Can someone explain the settings of pool_size of Ecto in config file? and what is the recommend size? Thanks
New
idi527
I’ve been re-reading swift book again and noticed that multiline strings there don’t have a trailing line break, unlike in elixir iex(2)...
New

Other popular topics Top

vac
Hi, I'm quite new in Elixir and I'm trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and ...
New
chrismccord
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 42633 214
New
johnnyicon
Hi all, I've just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I'm trying to use Postg...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
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
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New

We're in Beta

About us Mission Statement