Instrument all the end states of imports with GitHub importer

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Problem

On our SiSense dashboard (available internally) there is a chart showing success/failure rate of project import with GitHub importer on SaaS. This chart shows only Failure and Success, the partial import state, that is showed in the UI, is not reflected on this chart:

image

All the values on this chart are traced from these metrics:

  • 'redis_hll_counters.importer.github_import_project_start_monthly',
  • 'redis_hll_counters.importer.github_import_project_success_monthly',
  • 'redis_hll_counters.importer.github_import_project_failure_monthly'

This information is not detailed enough.

Proposed solution

  1. Instrument all possible end states of import, with structured Snowplow events (via GitLab::Tracking.event see https://docs.gitlab.com/ee/development/snowplow/implementation.html#implement-ruby-backend-tracking) so that the numbers can be tracked and shown on a chart. Possible end states:
  • completed - import finished, all the entities were imported
  • partially completed - not all entities were imported, but otherwise import has finished
  • failed - import failed with no resources imported to destination, project could not be created
  • cancelled - import was cancelled by the user.
  1. As Snowplow doesn't fully substitute RedisHLL we should keep current RedisHLL metrics:
  • 'redis_hll_counters.importer.github_import_project_start_monthly',
  • 'redis_hll_counters.importer.github_import_project_success_monthly',
  • 'redis_hll_counters.importer.github_import_project_failure_monthly'
  • 'redis_hll_counters.importer.github_import_project_start_weekly',
  • 'redis_hll_counters.importer.github_import_project_success_weekly',
  • 'redis_hll_counters.importer.github_import_project_failure_weekly'

and add new ones:

  • for partially completed - not all entities were imported, but otherwise import has finished - 'redis_hll_counters.importer.github_import_project_partially_completed_monthly' and 'redis_hll_counters.importer.github_import_project_partially_completed_weekly'
  • for cancelled - import was cancelled by the user - 'redis_hll_counters.importer.github_import_project_cancelled_monthly' and 'redis_hll_counters.importer.github_import_project_cancelled_weekly'
  • for completed - check if 'redis_hll_counters.importer.github_import_project_success_monthly' (and weekly) tracks the same situation, when import has finished, all the entities were imported. If yes, no action needed, if no - would need to change that one too, to track the same thing as Snowplow tracks.
  • for failed - check if 'redis_hll_counters.importer.github_import_project_failure_monthly' (and weekly) tracks the same situation, when import failed with no resources imported to destination, project could not be created. If yes, no action needed, if no - would need to change that one too, to track the same thing as Snowplow tracks.

See discussion for more context.

Edited by 🤖 GitLab Bot 🤖