Add new table to connect issues to metrics

What does this MR do and why?

  • Adds a new table observability_metrics_issues_connections to store the connection between an Issue and a Metric where metrics are stored in Gitlab Observability Backend.
    • This MR doesn't actually connect to GOB at all, so doesn't require it to validate the MR.
  • The table also includes a namespace_id sharding key for cells which is automatically populated using a Rails after_create callback.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

How to set up and validate locally

  1. Run the migrations in this MR (rails db:migrate)

  2. Open a rails console.

  3. Create a new instance of the model, with an issue and save it.

    a = Observability::MetricsIssuesConnection.new(issue: Issue.last, metric_type: :sum_type, metric_name: "testing1234")
    a.save!
  4. Note the additional UPDATE statement after the object is persisted that should set namespace_id.

Related to gitlab-org/opstrace/opstrace#2884 (closed)

Edited by Max Woolf

Merge request reports

Loading