User:Lucas Werkmeister (WMDE)/Grafana
I have grafana-admin access these days. (That said, the method here still works, it’s just not very convenient.)
I don’t have grafana-admin access, but I still sometimes want to see new metrics before someone else has added them to an existing Grafana board (or created a new one) for me. Totally possible! Just use the Render URL API of Graphite itself, on the https://graphite.wikimedia.org/render/ endpoint.
For example:
- https://graphite.wikimedia.org/render/?target=MediaWiki.wikibase.quality.constraints.check.timing.Q21502404_FormatChecker.p99&from=now-7d
- https://graphite.wikimedia.org/render/?target=alias(sum(MediaWiki.wikibase.quality.constraints.gadget.{loadEntity,loadProperty,saveStatement}.count),%20%22gadget%22)&target=alias(MediaWiki.wikibase.quality.constraints.api.checkConstraints.execute.count,%20%22api%22)&from=1513195200&width=1910&height=1190
target
contains whatever you want to render, and can be any metric expression. (It can also be specified several times.) The simplest case is to just specify a metric name – but beware: there is a MediaWiki.
prefix that you don’t see when you use the metric name in PHP ($wgStatsdMetricPrefix
), and you also need some suffix to inform Graphite what to do with the metric – for a counter, .count
makes sense, for timings, something like .p50
or .p99
.
See the Render URL API documentation for the kinds of paths and wildcards you can use in target
, as well as for all other URL parameters (width
, height
, yMax
, format
, etc.). See the Functions documentation to see what you can do with the metrics (a simple, useful function is alias(metric, "name")
, to assign a more readable name, especially if metric
is an expression).
Have fun!