Skip to content

Running-microservices metric should drop to zero after a CID's microservices are shut down #4741

Description

@allister-beamable

Summary

The daily running-microservices snapshot (microservice_state collection in the wizard_master database) never records a zero for a CID whose microservices have all been shut down. Once a CID drops to zero running instances, its most recent snapshot document persists unchanged indefinitely, so every downstream consumer (Portal's microservice usage charts, internal usage/revenue reporting) keeps reporting the last nonzero count.

The snapshot job runs daily (05:00 UTC).

Expected

When all of a CID's microservices are scaled to zero, its running-microservices count should read zero from that point forward. Usage charts and any period averages that include the post-shutdown days should reflect the drop.

Actual

The CID's snapshot stops updating at its last nonzero value and stays frozen there. Charts and reports show a phantom count equal to the pre-shutdown value for as long as the CID remains off. Monthly/period averages that span the shutdown stay elevated instead of trending toward zero.

How it manifests

  • A customer offboarded over a month ago (all microservices scaled to 0, verified 0 running tasks in ECS) still appears on the usage chart at its pre-shutdown service count.
  • Cross-referencing the chart against ECS -- the ground truth for running tasks -- shows 0 running while the chart shows the stale nonzero number.
  • From the collection alone there is no way to distinguish "still running at N" from "shut down, last seen at N."

Impact

  • Usage and revenue reporting overstates active microservice counts for offboarded or idled CIDs.
  • Offboarding verification cannot rely on the chart; it silently disagrees with reality, and the disagreement is indefinite rather than lagging by a day.
  • Period averages are biased upward for any CID that dropped to zero mid-period.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions