+1 to statsd as a great way to get started with as little friction as possible.  I've bubbled this up to the folks that make decisions about instrumentation, so if you find yourself wanting to do things beyond what's possible with statsv, please chime back in here and let us know.

On Thu, Nov 30, 2023 at 8:02 PM Krinkle <krinkle@fastmail.com> wrote:
I would suggest using the Statsd counters that WikimediaEvents exposes to MediaWiki JavaScript (including Gadgets and user scripts!). This is a public API, with aggregate data publicly accessible via Grafana.

These require no server-side configurations, schemas, or private data access. And (on the flipside) also do not record any personal information.

To use it, call mw.track( counter.gadget_<gadgetname>.<metricname> ) in your gadget.

For example:

mw.track( 'counter.gadget_VariantAlly.storage_empty_dialog' );

To make visualising easier, I've put together a generic dashboard to plot these:
https://grafana.wikimedia.org/d/000000037/gadget-stats

--
Timo Tijhof
https://timotijhof.net/




On Mon, 27 Nov 2023, at 09:33, psnbaotg via Wikitech-l wrote:

Hi there,

I'm User:Diskdance, and recently I'm developing a default gadget for Chinese Wikipedia enhancing MediaWiki's variant handling logic, and under certain circumstances a prompt is shown at page load asking for a user's preferred variant. Consider it as a conditional Cookie notice, and its English screenshot can be found at https://commons.wikimedia.org/wiki/File:VariantAlly-En.png.

I know this can be very disruptive on UX, so I tend to be careful about its negative impact on page views. If the gadget can collect telemetry data about the prompt's display frequency and user interactions (using e.g. WikimediaEvents), I can know about its possible impact.

Is this possible? It would be much appreciated if anybody could provide assistance.

Best wishes,
Diskdance

_______________________________________________
Wikitech-l mailing list -- wikitech-l@lists.wikimedia.org
To unsubscribe send an email to wikitech-l-leave@lists.wikimedia.org

_______________________________________________
Wikitech-l mailing list -- wikitech-l@lists.wikimedia.org
To unsubscribe send an email to wikitech-l-leave@lists.wikimedia.org
https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/