cloudfoundry / cloudfoundry/capi-release
Emit audit.app.process.ready and audit.app.process.not-ready events
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
- TPS - https://github.com/cloudfoundry/tps/pull/49
- RuntimeSchema - https://github.com/cloudfoundry/runtimeschema/pull/19
- Cloud controller - https://github.com/cloudfoundry/cloud_controller_ng/pull/3554
- Running CF Audit Events List Docs - https://github.com/cloudfoundry/docs-running-cf/pull/116
- CATs - https://github.com/cloudfoundry/cf-acceptance-tests/pull/997
- CAPI - I did not submit a PR to capi release to bump all of these things. Let me know if I should. I thought it might be easier for whoever merges all of these things to do it then.
Steps to Test
- Deploy the code from the PRs.
- Make sure you have at least Diego 2.81.0 deployed.
- Clone the code for the proxy app. It has good endpoints for testing health checks, including
/eventuallyfail,/eventuallysucceed, and/flap. - Update the proxy manifest to have a readiness health check for the
/flapendpoint (see diff below). - Push the proxy app
- Run
watch cf events APPand 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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