cloudfoundry / cloudfoundry/capi-release

Emit audit.app.process.ready and audit.app.process.not-ready events

Open
#363 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
24
Forks
110
Avg merge
3d 12h
Merged PRs (30d)
8

Description

Issue

We want cc to emit audit.app.process.ready and audit.app.process.not-ready events as an app passes and fails the readiness health check.

Context

We want to make it easier for app devs to know if their apps are "ready" or "not-ready" as determined by the readiness health check.

Related PRs

Steps to Test

  1. Deploy the code from the PRs.
  2. Make sure you have at least Diego 2.81.0 deployed.
  3. Clone the code for the proxy app. It has good endpoints for testing health checks, including /eventuallyfail, /eventuallysucceed, and /flap.
  4. Update the proxy manifest to have a readiness health check for the /flap endpoint (see diff below).
  5. Push the proxy app
  6. Run watch cf events APP and see the desired output.
diff --git a/src/example-apps/proxy/manifest.yml b/src/example-apps/proxy/manifest.yml
index bba43604..f3538084 100644
--- a/src/example-apps/proxy/manifest.yml
+++ b/src/example-apps/proxy/manifest.yml
@@ -4,5 +4,8 @@ applications:
     memory: 32M
     disk_quota: 32M
     buildpacks: [go_buildpack]
+    readiness-health-check-type: http
+    readiness-health-check-http-endpoint: /flap
+    readiness-health-check-interval: 10
     env:
       GOPACKAGENAME: proxy

Desired output

Every 2.0s: cf events potato                                                                                                                                                                              mammatus: Thu Dec 14 17:18:17 2023

Getting events for app potato in org system / space system as admin...
time                          event                         actor   description
2023-12-14T17:18:16.00+0000   audit.app.process.not-ready   web     index: 0, cell_id: c67943b4-79a1-450f-92d3-8e6ac141d4a0, instance: dc279be6-bc23-4a16-7b32-f83f
2023-12-14T17:17:36.00+0000   audit.app.process.ready       web     index: 0, cell_id: c67943b4-79a1-450f-92d3-8e6ac141d4a0, instance: dc279be6-bc23-4a16-7b32-f83f
2023-12-14T17:17:27.00+0000   audit.app.process.not-ready   web     index: 0, cell_id: c67943b4-79a1-450f-92d3-8e6ac141d4a0, instance: dc279be6-bc23-4a16-7b32-f83f
2023-12-14T17:16:47.00+0000   audit.app.process.ready       web     index: 0, cell_id: c67943b4-79a1-450f-92d3-8e6ac141d4a0, instance: dc279be6-bc23-4a16-7b32-f83f
2023-12-14T17:16:39.00+0000   audit.app.process.not-ready   web     index: 0, cell_id: c67943b4-79a1-450f-92d3-8e6ac141d4a0, instance: dc279be6-bc23-4a16-7b32-f83f
### Tasks
- [x] Docs
- [x] CATS
- [ ] CATS fails for windows. make this work

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 with the readiness-health-check integration described here and review the related Cloud Controller, TPS, RuntimeSchema, and CATS PRs; no implementation file is named. Configure the proxy app's manifest.yml with the /flap readiness endpoint, run cf events APP, and verify that readiness transitions emit the requested ready and not-ready audit events.

Written by the indexing model from the issue text.

Assessment

Domain
backend, cloud
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.