Skip to content

Use different logic when considering latest status for services #107

Open

Description

@scesjsu

vineet dont work on this

our status page, from today, looks like below. it says 2 services are down

Image

when we query metrics directly, it shows those same services are up

Image

the difference is because in the below code, we query if the services was 0 at any moment in the last hour, and if so, show a red emoji

url = urljoin(args.target, "api/v1/query_range")

how to fix

  • make get_prometheus_data do 2 queries
    • 1 for historical (we already do this)
    • 1 for latest status, we can use /api/query?query=up
  • change how we set the dataclass values, use this second query to set the last (latest) status
  • fill the rest of the dataclass values with the original query

see the readme for how to run the development version of this repo to test the status page.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions