Video in progress

An old service must be completely shut down (decommissioned). How do you find out who still uses it, and how do you run the process safely?

First I find the real users with data: traces and gateway logs, Kafka consumer groups, DB connections. Then a deprecation announcement, blocking new usage, help with migration, pre-announced "brownout" tests, and only when traffic drops to zero: stop it, archive it and delete it.

📖 Answer

Creating a service is easy, shutting it down is hard. Usually nobody knows for sure: of 8 teams saying "we don't use legacy-pricing", two still call it, one from a monthly report job that runs once a month.

  1. Who uses it:
  • the tracing service graph and gateway/mesh access logs, for at least 1–2 months, because there are monthly and quarterly jobs;
  • Kafka: the consumer groups of the topics the service writes to, and the producers of the topics the service reads;
  • DB: whoever connects directly to the service's database (the application_name and IPs in pg_stat_activity), often BI tools and scripts;
  • consumesApis in the catalog, the least reliable source.
  1. Announcement: lifecycle: deprecated in the catalog, Deprecation and Sunset headers in API responses, with a clear date. A personal message and a migration guide to each identified client's owner.

  2. Stopping new usage: no new clients are granted access (mesh policy, API key). The list only shrinks.

  3. Help with migration, which is often where most of the time goes. The needed function may be missing in the new service, and you should find that out at the start, not at the end.

  4. Brownout: at a pre-announced time, the service returns 503 for 10 minutes. If someone is still using it, you find out right away, not on the final day.

  5. When traffic hits zero: the service is stopped, but the infrastructure stays up for a 2–4 week "can be restored" period.

  6. Data: before deletion, check the legal retention requirements. The needed part goes into an archive in a readable format (with an owner), and the rest is deleted. Topics, secrets, DNS records, dashboards and alerts, the CI pipeline and the catalog entry get cleaned up too, otherwise "ghost" resources stay for years as a cost and a security risk.

The success criterion isn't "the service was deleted" but "nobody noticed".

The organizational side: plan the decommission as a project with an owner and a deadline. Otherwise it sits on the "we'll do it later" list for years and the organization keeps paying to run two systems.