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

badges.shields always returns label: gatus instead of endpoint name. #737

Open
reefland opened this issue Apr 16, 2024 · 2 comments
Open
Labels
bug Something isn't working

Comments

@reefland
Copy link

reefland commented Apr 16, 2024

Describe the bug

Working with Gatus to make badges, and no matter which endpoint I give it such as /api/v1/endpoints/internal_truenas/health/badge.shields the label is returned as gatus instead of the endpoint name (truenas in this case).

What do you see?

Label is always returned as gatus. I tried different groups and different endpoints.

{"color":"brightgreen","label":"gatus","message":"up","schemaVersion":1}

What do you expect to see?

I was expecting the label to equal to the value of the endpoint. Given an endpoint such as:

    endpoints:
      - name: truenas
        group: internal
        url: https://example.domain.com
       ...

Then I would expect "label:":"truenas".

List the steps that must be taken to reproduce this issue

Look at the raw json returned from various endpoints, IE: https://status.mydomain.com/api/v1/endpoints/internal_truenas/health/badge.svg results in:

{"color":"brightgreen","label":"gatus","message":"up","schemaVersion":1}

When using this with shields.io, such as https://img.shields.io/endpoint?url=https://status.mydomain.com/api/v1/endpoints/internal_truenas/health/badge.shields, it thus renders the wrong endpoint name:
image

Version

5.9.0

Additional information

  • If I try to supply an alternate label using &label=TrueNAS Storage it doesn't work (stops at the  ) ... another bug?
    image

  • However if I use &label=TrueNAS Storage or &label=TrueNAS%20Storage it does work:
    image

@reefland reefland added the bug Something isn't working label Apr 16, 2024
@onedr0p
Copy link

onedr0p commented Apr 16, 2024

You need to urlencode the space to %20, not  

@reefland
Copy link
Author

reefland commented Apr 16, 2024

You need to urlencode the space to %20, not  

I only bring this up as I was testing Kromgo and Uptime Kuma badges with shields.io as well, and these allow   as part of the label (I get its not really proper URL encoding, but its working).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants