Skip to content

Feature: Add listen_url field to the health check API#1416

Merged
josecelano merged 1 commit into
torrust:developfrom
josecelano:1409-include-service-type-in-health-check-enpoint
Mar 26, 2025
Merged

Feature: Add listen_url field to the health check API#1416
josecelano merged 1 commit into
torrust:developfrom
josecelano:1409-include-service-type-in-health-check-enpoint

Conversation

@josecelano

Copy link
Copy Markdown
Member

Added an extra listen_url field to th health check API endpoint:

http://127.0.0.1:1313/health_check

{
  "status": "Ok",
  "message": "",
  "details": [
    {
      "listen_url": "http://0.0.0.0:7070/",
      "binding": "0.0.0.0:7070",
      "service_type": "http_tracker",
      "info": "checking http tracker health check at: http://0.0.0.0:7070/health_check",
      "result": {
        "Ok": "200 OK"
      }
    }
  ]
}

It includes the protocol + binding address.

The binding is not removed for back compatibility.

NOTICE: HTTP URLs contain the trailing slash "listen_url": "http://0.0.0.0:1212/" because it's the default behavior.

@josecelano
josecelano requested a review from da2ce7 March 26, 2025 17:17
@josecelano josecelano added Enhancement / Feature Request Something New - Admin - Enjoyable to Install and Setup our Software labels Mar 26, 2025
@josecelano josecelano self-assigned this Mar 26, 2025
@josecelano josecelano linked an issue Mar 26, 2025 that may be closed by this pull request
```json
{
  "status": "Ok",
  "message": "",
  "details": [
    {
      "listen_url": "http://0.0.0.0:7070/",
      "binding": "0.0.0.0:7070",
      "service_type": "http_tracker",
      "info": "checking http tracker health check at: http://0.0.0.0:7070/health_check",
      "result": {
        "Ok": "200 OK"
      }
    }
  ]
}
```

The `binding` is not removed for back compatibility.
@josecelano
josecelano force-pushed the 1409-include-service-type-in-health-check-enpoint branch from 604a4e0 to abfb733 Compare March 26, 2025 17:20
@codecov

codecov Bot commented Mar 26, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.15%. Comparing base (9a10e3e) to head (abfb733).
Report is 2 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1416      +/-   ##
===========================================
- Coverage    83.17%   83.15%   -0.02%     
===========================================
  Files          233      233              
  Lines        17086    17090       +4     
  Branches     17086    17090       +4     
===========================================
  Hits         14211    14211              
- Misses        2608     2611       +3     
- Partials       267      268       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@josecelano

Copy link
Copy Markdown
Member Author

ACK abfb733

@josecelano
josecelano merged commit 7fef3e9 into torrust:develop Mar 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

- Admin - Enjoyable to Install and Setup our Software Enhancement / Feature Request Something New

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Include service type in health check enpoint

1 participant