Skip to content

Show finance metrics #1

Description

@victorb

The first version was supposed to show metrics for the registry and the finances, but ran out of time before being able to implement the backend side of things.

Uncommenting the following section should show some hardcoded values: https://github.com/open-services/open-registry-website/blob/master/index.html#L231-L345

What's missing is to have some recent hardcoded values instead of completely faked ones, so people without JS sees something.

If JS is activated, the page should hit an endpoint and parse the values to show the actual values. This could happen once every X seconds so we can updates values.

To get the metrics, there will be a GET request to something like:

# Warning: not yet implemented, hardcode in the meantime
curl 'http://metrics.open-registry.dev/api/v1/query?query=open_registry_balance'

And the response will look something like:

{
  "status": "success",
  "data": {
    "resultType": "vector",
    "result": [
      {
        "metric": {
          "__name__": "open_registry_balance",
          "instance": "finance:6000",
          "job": "application"
        },
        "value": [
          1557142394.476,
          "21322"
        ]
      }
    ]
  }
}

The correct value to read here is 21322 and you'll need to divide by 100 to
get the full value, so it's 213.22 and it's currency is EUR.

All different values for financing can be found here: https://github.com/open-services/finance-watch#examples

In the meantime, while I get the backend working, the response can be hardcoded in the website.

TODO

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions