andreyuhai
I think I don’t really get the idea of measurement options in Telemetry.Metrics.
I’ve got a function
def batch_process_jobs do
# process jobs somewhere here...
:telemetry.execute(
[:my_app, :jobs],
%{count: length(failed_task_ids)},
%{status: "failed"}
)
:telemetry.execute(
[:my_app, :jobs],
%{count: length(succeeded_task_ids)},
%{status: "succeeded"}
)
end
So the idea is I want to see how many jobs failed and how many jobs succeeded after a batch process. My thinking is that if I give the number of failed and succeeded jobs (by calculating the length of IDs) as the count I’d expect that much increase in my bar graph as I am grouping by status.
Below you can see an example graph. As you can see both succeeded (light blue) and failed (dark blue) job count are the same however that’s not the case actually.
Why does that happen? When and how to use the measurement options like I tried in this case by giving count?
Edit: I figured that the count in the graph is actually the number of times :telemetry.execute was invoked for that specific metric type. Since they are in the same block, they are called the same number of times regardless of the count value I pass. Not sure whether that helps.
Cheers,
Burak
Trending in Questions
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #elixirconf-eu
- #metaprogramming
- #hex











Showing Posts 1 to 1- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
andreyuhai
I think I’ve figured it out, I’ve tested it as well so it worked.
We are using
telemetry_metrics_statsdas the reporter and from its docs regarding thecountermetric:What I should’ve used instead is the
summetric:So I’ve changed this
into this:
I think I should’ve mentioned that in my question to start with, but I didn’t know it could be related. Sorry for that.