inadarei / rfc-healthcheck

Health Check Response RFC Draft for HTTP APIs

Home Page:https://inadarei.github.io/rfc-healthcheck/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

make format open/extensible by using a registry?

dret opened this issue · comments

it seems like there is a good set of initial values, but if that set may evolve over time to cover additional concepts. one popular model to cover this is to have a registry of values, with those defined in the original specification as the initial registry contents (https://tools.ietf.org/html/draft-wilde-registries-01). it all depends on how much this format is expected to evolve, and how easy that evolution should be. i am just pointing this out as an alternative design option for the format. i'd be more than happy to help with the specifics of establishing a registry.

Erik, this makes a lot of sense. I think in the case of health checks we need to err on the side of simplicity rather than flexibility. So, as opposed to a, say, generic media type that should cover many use-cases health check media type may want to be much more restrictive for the sake of interoperability.

That said, we are already mentioning several vocabularies that have initially defined values and may need to be extended in the future.

I guess what I am saying: extensions should be limited to current shape of JSON and whatever flexibility "details" provide, no more. However, in the details we have:

  1. type
  2. metricName
  3. merticUnit

that all could benefit from a registry for values: http://rawgit.com/inadarei/rfc-healthcheck/reusable-details/index.html

That is where I think registry would provide a lot of value here.

Do you agree?

@dret do you think you can provide an example wording of how this can be featured in the healthcheck RFC?

i am not saying this is a great way to do it (actually, to me it is strange that they now have to keep updating the document just to add more stat details), but for reference, here is how the WebRTC statistics API handles their data model: https://www.w3.org/TR/2018/WD-webrtc-stats-20180226/

just in case you're interested in more variations of how this could be done (all of them misguided in my mind and in need of a proper registry approach), i am maintaining a list of @w3c specs that in all likelihood should use registries, but don't: https://github.com/dret/RegMan/blob/master/W3C.md