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

Add RabbitMQ Monitoring Support to Uptime Kuma #5066

Closed
anton-dealmeida opened this issue Aug 30, 2024 · 3 comments Β· Fixed by #5199
Closed

Add RabbitMQ Monitoring Support to Uptime Kuma #5066

anton-dealmeida opened this issue Aug 30, 2024 · 3 comments Β· Fixed by #5199
Labels
feature-request Request for new features to be added

Comments

@anton-dealmeida
Copy link

πŸ“‘ I have found these related issues/pull requests

I could not find any open features to this

🏷️ Feature Request Type

API / automation options, New monitor

πŸ”– Feature description

Feature Description:

Add native support for RabbitMQ monitoring in Uptime Kuma. This feature will enable users to monitor the health and performance of RabbitMQ message brokers by integrating with RabbitMQ’s HTTP API. Key functionalities should include:

  • Health Checks: Verify operational status and connectivity of RabbitMQ nodes.
  • Metrics Collection: Track essential metrics such as queue lengths, message rates, consumer counts, and resource usage.
  • Alert Configuration: Allow users to set and customize thresholds for alerts based on collected metrics.

This addition will help users maintain the health of their RabbitMQ services, detect potential issues proactively, and customize monitoring to fit their specific needs.

βœ”οΈ Solution

Implement a RabbitMQ monitoring module in Uptime Kuma that integrates with RabbitMQ’s HTTP API. The module should include:

  • Health Checks: Ensure RabbitMQ nodes are operational and responsive.
  • Metrics Collection: Retrieve and display key metrics such as queue lengths, message rates, consumer counts, and resource utilization.
  • Alert Configuration: Enable users to set and customize alert thresholds for the collected metrics.

This solution ought to provide users with better insights into their RabbitMQ instances and help them address issues before they impact system performance.

❓ Alternatives

I have written custom health checks in GoLang previously that we use to check the cluster node health. My approach personally was an automated one to reduce the difficulty around configurations.

It's made up of

  1. Query the overview api endpoint (/api/overview)
    • When you query the /api/overview endpoint you get a big object back, I filter down to the { "context": [{...}] } array that is in the root. From there I grab context[x].node string and then use that in the next step.
  2. For each node listed in the response json body:
    • Query: "/api/healthchecks/node/" + context[x].node -- essentially it'll be that [email protected]
    • If response is 200 (aka node responded) check the json body, else it's unhealthy
    • If response body is { "status": "ok" } all is well, else unhealthy.

I then check basically what's the % of nodes online, I can in my little dummy check set whether or not the service is unhealthy or degraded or healthy.

A final alternative proposal

Alternatively, since it's just API JSON requests... perhaps adding the ability to script write some low level JavaScript or something to evaluate responses? Like if I get a response perhaps pick a property in a json response to iterate over and do something like make another call and then evaluate the response either for a json property being a value or an http status?

πŸ“ Additional Context

Some useful context... I'd say is probably the important parts of the actual APIs.

I know with RabbitMQ authenticating with just a user using Basic Auth is sufficient. I think that's good spot to just start.

/api/overview

{
  "contexts": [
    {
      "ssl_opts": { "keyfile": "", "cacertfile": "", "certfile": "" },
      "node": "[email protected]",
      "description": "RabbitQM Management",
      "path": "/",
      "cowboy_opts": "[{sendfile,false}]"
      "port": "15671",
      "ssl": "true"
    },
    {
      "ssl_opts": { "keyfile": "", "cacertfile": "", "certfile": "" },
      "node": "[email protected]",
      "description": "RabbitQM Management",
      "path": "/",
      "cowboy_opts": "[{sendfile,false}]"
      "port": "15671",
      "ssl": "true"
    },
    {
      "ssl_opts": { "keyfile": "", "cacertfile": "", "certfile": "" },
      "node": "[email protected]",
      "description": "RabbitQM Management",
      "path": "/",
      "cowboy_opts": "[{sendfile,false}]"
      "port": "15671",
      "ssl": "true"
    }
  ]
}

There's also other potentially useful stats in here but the important part for the health check itself to see if nodes are up or down is the context.

/api/healthcheck/node/[email protected]

{ "status": "ok" }
@anton-dealmeida anton-dealmeida added the feature-request Request for new features to be added label Aug 30, 2024
@CommanderStorm
Copy link
Collaborator

CommanderStorm commented Aug 30, 2024

I don't know anything about rabits..
If (you as an expert, or someone else) were to provide a PR, that would be helpful.
I think our contribution guide is pretty helpful in what files need to be changed for something like that.

There are two things to consider:

@Suven-p
Copy link
Contributor

Suven-p commented Oct 11, 2024

I would like to take on this issue but I am not sure about Metrics Collection and customize alert thresholds for the collected metrics.. Is there any other monitor that does this for reference?

@CommanderStorm
Copy link
Collaborator

Lets just start with just Health Checks, unless the other requested features are simple to query and review alongside.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features to be added
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants