Skip to content

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

Open
@ameowlia

Description

@ameowlia

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions