question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Request: expose a port/endpoint for healthchecks

See original GitHub issue

Summary

It would be helpful if apps using kombu were able to expose a port and/or endpoint for the purposes of healthchecks and monitoring. For example, a GET request to http://localhost:8080/running might give a response of 200 - {"running": true} while a kombu consumer is running.

Use cases

When running apps in kubernetes, it’s useful to be able to expose an endpoint for monitoring purposes (https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/). For example, as part of a k8s deployment you might have:

containers:
      - name: my-container
        image: myimage:latest
        ports:
        - containerPort: 8080
        livenessProbe:
          httpGet:
            path: /running
            port: 8080
        readinessProbe:
          httpGet:
            path: /running
            port: 8080

If the app crashes, kubernetes would then know to terminate the pod and bring up a new one.

Healthcheck or monitoring endpoints are also useful for situations where you need to know when an app running in a container is ready, for example in docker-compose stacks.

Proposal

The proposal is for kombu to stand up an HTTP endpoint, which returns an “OK” status code on being hit with an HTTP request, while a consumer is listening. This port would be used externally to monitor whether the app is still consuming.

If I have missed some functionality of kombu which could be used as an alternative, please let me know - I haven’t found anything in the documentation.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
Anmol-Porwal18commented, Jan 7, 2022

@jonadaly I’ve created a package for supporting TCP liveness check and with writing adapters for kombu consumers here: https://github.com/Anmol-Porwal18/kube_kombu

2reactions
thedrowcommented, Jul 28, 2020

Kombu is not designed to be a full solution for executing queued tasks. It just abstracts the connection to message brokers and puts them under one interface.

You can implement such a healthcheck yourself or try using Celery’s ping task periodically.

I’m going to close this issue because it is out of scope for this library.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Health checks in ASP.NET Core | Microsoft Learn
Health checks are exposed by an app as HTTP endpoints. Health check endpoints can be configured for various real-time monitoring scenarios:.
Read more >
Health Checks with Spring Boot - Reflectoring
In this article, we will build health check functions in Spring ... an endpoint exposed by the application instances at fixed intervals.
Read more >
Values that you specify when you create or update health ...
When you create or update health checks, you specify the applicable values. Note that you can't change some values after you create a...
Read more >
A guide to API health check - Testfully
At its core, the API health check is an API monitoring method that ... API ping endpoint responds to requests with a basic...
Read more >
Health Checks in ASP.NET Core
Health checks are a new middleware available in ASP.NET Core 2.2. It provides a way to expose the health of your application through...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found