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 REQUEST]: Simplifying the health check of the entire Application Server #1998

Closed
Kaspiman opened this issue Sep 2, 2024 · 5 comments · Fixed by roadrunner-server/status#79
Assignees
Labels
C-feature-accepted Category: Feature discussed and accepted S-RFC Request: Request for comments
Milestone

Comments

@Kaspiman
Copy link

Kaspiman commented Sep 2, 2024

Plugin

Status

I have an idea!

I have an idea! I propose to reconsider the mechanics of determining server health.

Problem:

According to the documentation, you need to list the plugins to check.

When enabling and disabling the plugin on a project, you must not forget about the health-check address. This makes it necessary to synchronize the list of plugins manually. For example: http://127.0.0.1:2114/health?plugin=http&plugin=grpc.

The problem becomes more widespread when developing a large number of services. For example, I want to do a standard deployment for Kubernetes with standart healthchecks for all services in company.

k8s deployment fragment:

...
readinessProbe:
      httpGet:
        path: /health?plugin=http&plugin=grpc
        port: 2114
      initialDelaySeconds: 5
      periodSeconds: 10
    livenessProbe:
      httpGet:
        path: /health?plugin=http&plugin=grpc
        port: 2114
      initialDelaySeconds: 15
      periodSeconds: 20
...

Different services may have different sets of plugins and different addresses for health checks. It is possible that some of the services will not have an HTTP plugin at all.

The need to explicitly specify the list of plugins in the parameters makes it impossible to standardize such checks. You will have to manually control this list, which will inevitably lead to "forgotten" plugins and unreliable health information.

Proposal:

Define the concept of "application server is healthy". Make a single source for determining the health of the entire application server.

For example: request /health without parameters will be successful if all enabled plugins are healthy. The list of enabled plugins can be easily calculated in a future version of RR (see [🧹 CHORE]: RoadRunner v2025 thoughts "Add enabled=true/false to the plugins' configuration").

Now that request returns HTTP 400 Bad Request error: "No plugins provided in query. Query should be in form of: health?plugin=plugin1&plugin=plugin2". Backward compatibility will not be broken since it is not possible to use this method without parameters.

Single source of healthcheck will:

  • provide a single and reliable source of information
  • simplify and standardize deployments
...
readinessProbe:
      httpGet:
        path: /health
        port: 2114
      initialDelaySeconds: 5
      periodSeconds: 10
    livenessProbe:
      httpGet:
        path: /health
        port: 2114
      initialDelaySeconds: 15
      periodSeconds: 20
...
@Kaspiman Kaspiman added the C-feature-request Category: feature requested, but need to be discussed label Sep 2, 2024
@rustatian rustatian moved this to 📋 Backlog in Jira 😄 Sep 2, 2024
@rustatian rustatian added the S-RFC Request: Request for comments label Sep 2, 2024
@RoadToDeveloper

This comment has been minimized.

@ivanfilatov

This comment has been minimized.

@alfacrab

This comment has been minimized.

@rustatian
Copy link
Member

rustatian commented Sep 5, 2024

Hey @Kaspiman 👋
I understand what's happening here, however, /health endpoint is a common practice.
RR internal mechanism to deduce active plugins work w/o enable=true/false configuration option; thus it'd be easy to get all plugins implementing health checks.

I'll also update the output of the endpoint in case of failure (non-healthy plugin(s)) to be in JSON form to be easily parsed, instead of just text representation. Smt like this:

{
    [
        "<plugin_name>": {
        "status": 200,
        "error (in case of non-200 status)" : "error message" 
        }
    ]
}

It would be implemented in the v2024.3.0. Thanks, everyone who voted 👍

@rustatian rustatian added C-feature-accepted Category: Feature discussed and accepted and removed C-feature-request Category: feature requested, but need to be discussed labels Sep 5, 2024
@rustatian rustatian moved this from 📋 Backlog to 🔖 Ready in Jira 😄 Sep 5, 2024
@rustatian rustatian added this to the v2024.3 milestone Sep 5, 2024
@Kaspiman
Copy link
Author

Kaspiman commented Sep 5, 2024

Thanks, nice to hear!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-accepted Category: Feature discussed and accepted S-RFC Request: Request for comments
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

5 participants