Add gdk send-telemetry command for sending custom telemetry events

What does this merge request do and why?

This MR adds the gdk send-telemetry <metric> <value> command to send custom telemetry metrics (like rspec_setup_duration) from GitLab monolith when running in GDK.

Related to #2683 (closed)

How to set up and validate locally

  1. cd gdk && git checkout 2683-capture-rspec-setup-time && gdk config set gdk.debug true
  2. cd gitlab && git checkout 2683-send-rspec-setup-time && bundle exec rspec spec/lib/gitlab/git/repository_spec.rb
  3. You should see something like:
    Test environment set up in 2.48578 seconds
    ⛏️  DEBUG: Telemetry event sent: metric=rspec_setup_duration, value=2.48578
  4. Check ClickHouse to confirm the data was sent: https://console.clickhouse.cloud/services/9a2ea0ba-76d8-4bdc-8054-8496e767a9d6/console/query/55ac1da6-c525-4d20-97ff-088a74c448b7.

Impacted categories

The following categories relate to this merge request:

Merge request checklist

  • This MR references an issue describing the change.
  • This change is backward compatible. If not, please include steps to communicate to our users.
  • Tests added for new functionality. If not, please raise an issue to follow-up.
  • Documentation added/updated, if needed.
  • Announcement added, if change is notable.
  • gdk doctor test added, if needed.
Edited by Nao Hashizume

Merge request reports

Loading