Closed pragmaticivan closed 2 years ago
Hm, I wonder whether separate metric for T is really required to do this? Or do you want to configure that Apdex base value at application level?
Usually, T has a default value in some platforms like NewRelic and Datadog, and you can change that value. So I would think defaulting to something and allowing the user to change would be ideal (on the application level).
I discussed it with operations folks and they said that it makes sense to add such a gauge if you define alerts in Prometheus, but in case if you manage alerts in Grafana, then it is much better to have these settings in Grafana also.
I think I will make this gauge optional, so you will need to enable it explicitly.
Yes, I actually have 2 projects that might accomplish what you mentioned.
I think it might be worth having a gauge for that but also publishing a metric for the value of T for querying purposes.
Hey, @pragmaticivan, please try #18, whether it is what you want?
Point yabeda-rails
in your application's Gemfile
to this pull request:
gem "yabeda-rails", git: "https://github.com/yabeda-rb/yabeda-rails", branch: "feature/apdex-target-gauge"
Configure T value whether by setting YABEDA_RAILS_APDEX_TARGET
or any other method supported by anyway_config gem.
YABEDA_RAILS_APDEX_TARGET=0.1 rails server
See rails_apdex_target_seconds
gauge (with value of T set by you) is being reported to Prometheus
rails_apdex_target_seconds{} 0.5
Just confirming that it was intentional. That PR only covers a small part of this ticket.
It registers the apdex target but doesn't calculate the apdex based on this target.
Application code isn't a good place to calculate Apdex score itself. It is even impossible to do as Yabeda doesn't store timestamps of measurements. Prometheus (or other monitoring system) does.
You can and should calculate Apdex in your Grafana dashboard or Prometheus config (as stated in the article you provided).
Sounds good @Envek thanks! Will test it today.
Ref: https://medium.com/@tristan_96324/prometheus-apdex-alerting-d17a065e39d0
Accept
T
as optional param and default it to something like 1s.