Page MenuHomePhabricator

Add annotations per URL tested in WebPageTest
Closed, ResolvedPublic

Description

We should send annotation per run to Graphite with links to the result page.

In sitespeed.io I've implemented automatic annotations (with specific tags) that is sent per tested URL so that you easily can go from Grafana to a specific run. It looks like this:

Screen Shot 2017-11-13 at 8.31.19 AM.png (1×2 px, 330 KB)

When you click on the "Result 11 run(s)" link, you get to the result page (in our case the specific summary page on http://wpt.wmftest.org/).

Event Timeline

When we upgrade to Grafana 4.6.X we can test out the new annotation API in Grafana = we can open up only for Grafana instead of using the Graphite API.

That seems pretty straightforward as long as we can have the access: http://docs.grafana.org/http_api/annotations/

It also has a Graphite compatible API.

Krinkle triaged this task as Medium priority.Nov 14 2017, 10:03 PM

To reply to @Peter in T180428#3762974.

I don't want to be a blocker, just pointing out that if we (as in WMF) are planning to use extensively Grafana's own annotations, maybe we should consider moving it's backend database from SQLite to another DB.
The other approach would be to use any of the other compatible annotations backends for extensive usage and keep Grafana own ones just for the manual annotations.

I've done a quick check and our current DB size is 84 MB, that includes already ~9000 rows in the annotation table, mostly (if not all) of them seems to be generated by the Grafana alerts (see http://docs.grafana.org/alerting/rules/#alert-state-history-annotations):

Alert state changes are recorded in the internal annotation table in Grafana’s database

This is probably another thing we should check, going forward with the use of Grafana alerts.

@Volans cool, I see your point. It's better to be prepared before we start instead of fix things when they break :) For the WebPageTest annotations we should plan for adding a job to delete them after X days or whatever time. We could have something like that with the alerts too.

Peter renamed this task from Add annotations per run in WebPagetest to Add annotations per URL tested in WebPagetest.Nov 22 2017, 11:37 AM

If we will use the Grafana API (and I think we should, because then we can use the Authorization for the API) then we need to wait for Grafanas annotation to support template variables https://github.com/grafana/grafana/pull/10163

Collect output, publish internally within Jenkins for consumption by another job.

Peter removed a project: Upstream.

Woho! Templates in Grafana was released in 5.3.0 beta 2 (there's a beta 3 out there now). This means that when we upgrade to 5.3.0 we could potentially start using the Grafana API.

Also https://github.com/grafana/grafana/issues/8224 will be nice to have. I think already today should add a script that empties the alerts from the DB (only keeping one month or something like that).

Moving to the new setup after the summer we will automatically have it.

aaron renamed this task from Add annotations per URL tested in WebPagetest to Add annotations per URL tested in WebPageTest.Jun 6 2019, 9:42 AM
Peter claimed this task.

This was fixed when we rolled up the new setup before Christmas.