Phoenix Telemetry Metrics - how to count the number of logs?

Good Day Elixir Community.

I am trying to get a counter working using Telemetry.Metrics on hex docs. For example, I want to count the number of logs .
How do I get the Telemetry.Metrics.Counter value and show on the console/terminal.

Your assistance will be appreciated.

Telemetry.Metrics is just for defining metrics – as in declaring what should should be measured. It doesn’t measure though. You need a reporter to take care of that part:

https://hexdocs.pm/telemetry_metrics/writing_reporters.html

How you can query for the current value depends on the reporter used.

4 Likes