cloudfoundry / cloudfoundry/cloud_controller_ng

Metrics may not be emitted for cleanup jobs

Open
#3,688 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
207
Forks
373
Avg merge
2d 12h
Merged PRs (30d)
56

Description

Issue

Currently it is possible for the periodic updater not to emit metrics for daily cleanup jobs.

Context

The periodic updater looks at the delayed_jobs table to populate the known jobs and their queue lengths in order to emit metrics.

The metrics are emitted by cloud controller on the api nodes, if no api node sees the temporary insertion of the row in the delayed_jobs table before cc-worker picks it up then the job will not have a metric emitted.

It seems like for similar behaviour with the local worker a change was made to ensure that metrics would always be emitted: 0fddfd413e89f5c14fe9f71241628e7aeadb68c7

Steps to Reproduce

  • Deploy Cloud Foundry with a small number of api instances
  • Wait for a cleanup job to run
  • Occasionally observe that job metrics are not emitted

Expected result

Job queue metrics are emitted.

Current result

Job queue metrics are sometimes not emitted.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading lib/cloud_controller/metrics/periodic_updater.rb and lib/cloud_controller/clock/scheduler.rb, then compare the referenced local-worker change 0fddfd413e89f5c14fe9f71241628e7aeadb68c7. Trace how cleanup jobs appear in delayed_jobs before cc-worker picks them up; done means cleanup job queue metrics are emitted reliably even when the row is short-lived.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
backend, observability-sre
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.