n1k0 / wordlem

A simplistic port of the popular Wordle game in Elm.
https://n1k0.github.io/wordlem
Do What The F*ck You Want To Public License
17 stars 4 forks source link

add some basic observability to the app #9

Open phrawzty opened 2 years ago

phrawzty commented 2 years ago

Why not add some basic observability and global stats to the app? Could be fun to have a dashboard that graphs aggregate things like games played, average number of guesses, whatever (nothing uniquely identifiable, ofc). It's not required functionality but it could be a good learning opportunity for adding o11y to a web app written in elm. Of course I would suggest Datadog for the destination. :)

phrawzty commented 2 years ago

To be clear I mean, for me, this could be a good learning opportunity haha. I don't do frontend, I've never touched elm, and I also have never tried to make a webapp talk to Datadog. What could possibly go wrong? ;)

n1k0 commented 2 years ago

Haha I was avoiding setting up a server at all costs, though I agree this would be sweet to have. Now I don't know datadog at all, but if an API is available I don't see any roadblock tbh… Sending HTTP requests using Elm is not super hard but handling responses (error case, decoding JSON, etc) might be a little tricky. But if we're talking "fire & forget" strategy to collect event data, that might actually be super simple because then we don't care about the response result. Trickiest part would be authentication and token storage, especially as we're open source and we don't want other people to send crap using our token.

I don't know if Datadog allows public dashboards, but if not, setting up a simple page in Elm to render a few metrics from a Datadog API call should be rather straightforward.

Do you have a pointer to what you had in mind as a datadog API to use?