You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
At my company when creating a chart for when some queue gets zero jobs executing after some time I faced that Oban is not sending when a queue state reaches the number 0
So, I'm interested to understand when the queue create_order in the state executing gets 0 but it's not possible since this metric is implemented as last_value(implementation) and we are keeping the last value of the last pooling round (ex: 5 seconds before finishing the creation the value was 10).
To Reproduce
Steps to reproduce the behavior:
Add the following plugins to PromEx: Oban
Create some application with one queue at least (could be the queue default)
Create a job with a sleep of 5 seconds for this queue and trigger it once
After 15 seconds (to force overlap one polling window) check in the /metrics about the state of the queue default for the state executing and you will see the value 1 even the job has the state completed
Expected behavior
I expected that for all possible Oban Job states ([:scheduled, :available, :executing, :retryable, :cancelled, :completed, :discarded]) the PromEx Oban plugin sets as 0 if the state wasn't found into the database, avoiding the wrong value set into the last_value metric.
Environment
Elixir version: 23.2.3
Erlang/OTP version: 1.13.1-otp-23
Grafana version: Not needed
Prometheus version: Not needed
Additional context
The text was updated successfully, but these errors were encountered:
After fetching all queue states from the database, using the function Oban.states() for each queue we can set as 0 for states didn't find, for example, for the queue create_order we se the state executing as 0 after don't have any job executing.
DB query will only count jobs that exist. When counts for a particular queue state combination disappears from one poll to the next, some tools will show the stale last-seen count, when the true count is zero.
This change will include zeros for all missing queue + state combinations. Queues are taken from the Oban config, and Oban exposes all possible states in `Oban.Job.states/0`.
This addresses issue akoutmos#202
* Include zeros for missing queue states in polling metrics
DB query will only count jobs that exist. When counts for a particular queue state combination disappears from one poll to the next, some tools will show the stale last-seen count, when the true count is zero.
This change will include zeros for all missing queue + state combinations. Queues are taken from the Oban config, and Oban exposes all possible states in `Oban.Job.states/0`.
This addresses issue #202
* string map keys for zeros
---------
Co-authored-by: Martin Svalin <martin@lite.nu>
Describe the bug
At my company when creating a chart for when some queue gets zero jobs executing after some time I faced that Oban is not sending when a queue state reaches the number 0
Running the same query that we run to fetch queues grouped by state I could see a pattern like this:
Example:
Queues: create_order and deliver_order
After creating an order the job gets completed and triggered to deliver, so the response of the query will be:
After some time my program will finish the creation and I'll have:
So, I'm interested to understand when the queue
create_order
in the stateexecuting
gets 0 but it's not possible since this metric is implemented aslast_value
(implementation) and we are keeping the last value of the last pooling round (ex: 5 seconds before finishing the creation the value was 10).To Reproduce
Steps to reproduce the behavior:
default
)/metrics
about the state of the queuedefault
for the stateexecuting
and you will see the value 1 even the job has the statecompleted
Expected behavior
I expected that for all possible Oban Job states (
[:scheduled, :available, :executing, :retryable, :cancelled, :completed, :discarded]
) the PromEx Oban plugin sets as 0 if the state wasn't found into the database, avoiding the wrong value set into thelast_value
metric.Environment
23.2.3
1.13.1-otp-23
Additional context
The text was updated successfully, but these errors were encountered: