Skip to content

Simple wrapper around MongoDB to allow storage and retrieval of metrics

License

Notifications You must be signed in to change notification settings

OpenAddressesUK/metrics-api

 
 

Repository files navigation

Build Status Dependency Status Coverage Status Code Climate License Badges

ODI Metrics API

A simple wrapper around MongoDB to allow storage of time series metrics.

Fetching data

All requests should include Content-type: application/json.

GET https://metrics.theodi.org/metrics[.json]

Fetches list of available metrics

GET https://metrics.theodi.org/metrics/{metric_name}[.json]

Fetches latest value for specified metric

GET https://metrics.theodi.org/metrics/{metric_name}/{time}

Fetch the most recent value of the metric at the specified time. time is an ISO8601 date/time.

GET https://metrics.theodi.org/metrics/{metric_name}/{from}/{to}

Fetch all values of the metric between the specified times. from and to can be either:

  • An ISO8601 date/time
  • An ISO8601 duration
  • *, meaning unspecified

Adding data

POST https://metrics.theodi.org/metrics/{metric-name}

using a JSON content type, and with the following JSON in the body:

{
  "name": "{metric-name}",
  "time": "{iso8601-date-time}",
  "value": ...
}

value is any valid JSON structure or number. }

About

Simple wrapper around MongoDB to allow storage and retrieval of metrics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • CSS 77.8%
  • Ruby 11.8%
  • Gherkin 10.1%
  • HTML 0.3%