Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Healthcheck for the application itself #51

Open
freefd opened this issue May 12, 2024 · 2 comments
Open

Feature: Healthcheck for the application itself #51

freefd opened this issue May 12, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@freefd
Copy link
Contributor

freefd commented May 12, 2024

The frigate-notify docker image is Scratch-based, which means any additional utils are missing (even shell and ps tools).

In this situation, to add the ability to perform healthcheck there is an approach like the traefik did. Compose notation:

servicename:
...
    healthcheck:
      test: traefik healthcheck --ping
...

Thus, probably, the following could also be enough:

./frigate-notify healthcheck

The list of possible unhealthy criteria:

  1. Configuration malformed: https://github.com/0x2142/frigate-notify/blob/main/config/config.go#L199-L214
  2. Frigate (over Web API): https://github.com/0x2142/frigate-notify/blob/main/config/config.go#L252-L281
    1. Endpoint is unreachable (monitor feature)
    2. Authentication has failed (Feature Request)
    3. HTTP response codes >= 400
  3. MQTT: https://github.com/0x2142/frigate-notify/blob/main/events/mqtt.go#L20-L51
    1. Endpoint is unreachable
    2. Authentication has failed
    3. Topic does not exist
  4. Notifier X is configured
    1. Endpoint is unreachable
    2. Authentication has failed
@0x2142 0x2142 self-assigned this May 13, 2024
@0x2142 0x2142 added the enhancement New feature or request label May 13, 2024
@freefd
Copy link
Contributor Author

freefd commented Nov 2, 2024

Dear @0x2142, since you started implementing the REST API from #125, it seems that here we can move on to a more common way of implementing healthcheck endpoints - the well-known z-pages approach:

Thus, regardless of having the /status informational endpoint, for the m2m communications the app requires endpoints for Liveness and Readiness probes:

The direct mapping is

  • Readiness => /api/vX/readyz
  • Liveness => /api/vX/healthz

From the response perspective, liveness endpoint can just return {"status":"ok"} with HTTP 200 OK, while the readiness endpoint returns an entire message like {"status":"probename is not yet ready"}.

@0x2142
Copy link
Owner

0x2142 commented Nov 4, 2024

Sounds good, I can include that 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants