Skip to content

Backfill clusters_integration_prometheus.enabled

What does this MR do?

Next step of #327655 (closed), building on !60877 (merged). Once this has been rolled out, we can start relying on the integration record as the source of truth for whether the in-cluster prometheus is available.

Migration output

$ RAILS_ENV=test bin/rails db:migrate
== 20210519104931 BackfillClustersIntegrationPrometheusEnabled: migrating =====
== 20210519104931 BackfillClustersIntegrationPrometheusEnabled: migrated (0.0017s) 

$ RAILS_ENV=test bin/rails db:rollback
== 20210519104931 BackfillClustersIntegrationPrometheusEnabled: reverting =====
== 20210519104931 BackfillClustersIntegrationPrometheusEnabled: reverted (0.0000s) 

#database-lab output

https://gitlab.slack.com/archives/CLJMDRD8C/p1621467221098100 (internal link)

Summary

Time: 866.382 ms
  - planning: 1.024 ms
  - execution: 865.358 ms
    - I/O read: 19.630 ms
    - I/O write: 0.000 ms

Shared buffers:
  - hits: 57148 (~446.50 MiB) from the buffer pool
  - reads: 211 (~1.60 MiB) from the OS file cache, including disk I/O
  - dirtied: 140 (~1.10 MiB)
  - writes: 107 (~856.00 KiB)

Plan with execution

  ModifyTable on public.clusters_integration_prometheus  (cost=0.08..1032.10 rows=9337 width=89) (actual time=87.112..87.115 rows=0 loops=1)
   Buffers: shared hit=57148 read=211 dirtied=140 written=107
   I/O Timings: read=19.630 write=0.000
   CTE executed_at
     ->  Result  (cost=0.00..0.01 rows=1 width=8) (actual time=0.029..0.030 rows=1 loops=1)
           I/O Timings: read=0.000 write=0.000
   InitPlan 2 (returns $1)
     ->  CTE Scan on executed_at  (cost=0.00..0.02 rows=1 width=8) (actual time=0.032..0.033 rows=1 loops=1)
           I/O Timings: read=0.000 write=0.000
   InitPlan 3 (returns $2)
     ->  CTE Scan on executed_at executed_at_1  (cost=0.00..0.02 rows=1 width=8) (actual time=0.000..0.001 rows=1 loops=1)
           I/O Timings: read=0.000 write=0.000
   InitPlan 4 (returns $3)
     ->  CTE Scan on executed_at executed_at_2  (cost=0.00..0.02 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=1)
           I/O Timings: read=0.000 write=0.000
   ->  Seq Scan on public.clusters_applications_prometheus  (cost=0.00..1032.03 rows=9337 width=89) (actual time=1.422..19.939 rows=9340 loops=1)
         Filter: (clusters_applications_prometheus.status = ANY ('{3,11}'::integer[]))
         Rows Removed by Filter: 5222
         Buffers: shared read=195 dirtied=21
         I/O Timings: read=9.783 write=0.000

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.

  • [-] Label as security and @ mention @gitlab-com/gl-security/appsec
  • [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • [-] Security reports checked/validated by a reviewer from the AppSec team
Edited by Hordur Freyr Yngvason

Merge request reports