Create command line monitor for internal events tracking
What does this MR do and why?
Adds a script that makes it way easier to monitor which metrics are updated and which Snowplow events are triggered.
Currently it takes a lot of work and looking around in the Service Ping payload to verify that metrics got updated. This script removes that pain point in many cases.
Video demo:
This script does not have any test and the code show very clearly that this is a proof of concept.
In the spirit of iterating and providing value as early as possible, I suggest that we merge it now and address the test and code structure another issue: #426630
How to set up and validate locally
- Open two terminals
- Start the monitor in Terminal
1
by runningbin/rails runner scripts/internal_events/monitor.rb i_code_review_saved_replies_use i_code_review_saved_replies_create
- Start a Rails console in Terminal
2
by runninggdk rails console
- Trigger an event in
2
by executing:Gitlab::InternalEvents.track_event("i_code_review_saved_replies_create", user: User.last, namespace: Namespace.last)
- Verify in Terminal
2
that:- The metrics defined on
i_code_review_saved_replies_create
increased (If you didn't already trigger an event with this user previously) - A new Snowplow event appeared on the list with the correct
event_name
,user_id
andnamespace_id
- The metrics defined on
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Jonas Larsen