Skip to content

Include service type in health check enpoint #1409

Description

@josecelano

To make the API more self-discoverable we should include the URL and type of the service of the service instead of only the socket address (binding) in the health check report.

Current endpoint

URL: http://127.0.0.1:1313/health_check

{
  "status": "Ok",
  "message": "",
  "details": [
    {
      "binding": "0.0.0.0:6969",
      "info": "checking the udp tracker health check at: 0.0.0.0:6969",
      "result": {
        "Ok": "Connected"
      }
    },
    {
      "binding": "0.0.0.0:6868",
      "info": "checking the udp tracker health check at: 0.0.0.0:6868",
      "result": {
        "Ok": "Connected"
      }
    },
    {
      "binding": "0.0.0.0:7171",
      "info": "checking http tracker health check at: http://0.0.0.0:7171/health_check",
      "result": {
        "Ok": "200 OK"
      }
    },
    {
      "binding": "0.0.0.0:1212",
      "info": "checking api health check at: http://0.0.0.0:1212/api/health_check",
      "result": {
        "Ok": "200 OK"
      }
    },
    {
      "binding": "0.0.0.0:7070",
      "info": "checking http tracker health check at: http://0.0.0.0:7070/health_check",
      "result": {
        "Ok": "200 OK"
      }
    }
  ]
}

New proposal

{
  "status": "Ok",
  "message": "",
  "details": [
    {
      "type": "udp_tracker",
      "url": "udp://0.0.0.0:6969",
      "binding": "0.0.0.0:6969",
      "info": "checking the udp tracker health check at: 0.0.0.0:6969",
      "result": {
        "Ok": "Connected"
      }
    },
    {
      "type": "udp_tracker",
      "url": "udp://0.0.0.0:6868",
      "binding": "0.0.0.0:6868",
      "info": "checking the udp tracker health check at: 0.0.0.0:6868",
      "result": {
        "Ok": "Connected"
      }
    },
    {
      "type": "http_tracker",
      "url": "http://0.0.0.0:7171",
      "binding": "0.0.0.0:7171",
      "info": "checking http tracker health check at: http://0.0.0.0:7171/health_check",
      "result": {
        "Ok": "200 OK"
      }
    },
    {
      "type": "tracker_rest_api",
      "url": "http://0.0.0.0:1212",
      "binding": "0.0.0.0:1212",
      "info": "checking api health check at: http://0.0.0.0:1212/api/health_check",
      "result": {
        "Ok": "200 OK"
      }
    },
    {
      "type": "http_tracker",
      "url": "http://0.0.0.0:7070",
      "binding": "0.0.0.0:7070",
      "info": "checking http tracker health check at: http://0.0.0.0:7070/health_check",
      "result": {
        "Ok": "200 OK"
      }
    }
  ]
}

cc @da2ce7

Activity

  1. added
    - Admin -
    on Mar 24, 2025
  2. added
    Easy
    good first issue
    on Mar 24, 2025
  3. added a commit that references this issue on Mar 26, 2025
  4. josecelano commented on Mar 26, 2025

    @josecelano
    MemberAuthor

    Partially implemented via #1413

  5. josecelano commented on Mar 26, 2025

    @josecelano
    MemberAuthor

    Partially implemented via #1413

    Depends on #1415 to finish the implementation.

  6. josecelano commented on Mar 26, 2025

    @josecelano
    MemberAuthor

    Partially implemented via #1413

    Depends on #1415 to finish the implementation.

    Instead of implementing #1415 I'm going to finish this because there are related but can be merge independently.

    On the other hand, I think I'm going to use a different name for the url field. I will called it: listen_url.

  7. self-assigned this
    on Mar 26, 2025
  8. added a commit that references this issue on Mar 26, 2025
  9. added 2 commits that reference this issue on Mar 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

- Admin -EasyEnhancement / Feature Requestgood first issue

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions