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

Register content-type? #79

Closed
RichiH opened this issue May 8, 2018 · 7 comments
Closed

Register content-type? #79

RichiH opened this issue May 8, 2018 · 7 comments

Comments

@RichiH
Copy link
Member

RichiH commented May 8, 2018

Do we need to register openmetrics/text or text/openmetrics somewhere? https://github.com/RichiH/OpenMetrics/issues/8

@satterly
Copy link

It should probably be "application/openmetrics".

See https://tools.ietf.org/html/rfc2046#section-4.5

@SuperQ
Copy link
Member

SuperQ commented Sep 15, 2018

@satterly The format is intended to be human readable text, not a binary format. But application might make sense.

@hollodotme
Copy link

IMO text/openmetrics makes sense. As @SuperQ said, it's a human-readable text format/standard and nothing application specific.

Media types should be registered at iana.org.
Here's the list of all text media types.

How to register a media type is explained in this RFC, where section 4.2.1 also says that a charset parameter must be added, if the charset is not laid out in the payload itself, like in text/xml.

So text/openmetrics; charset=utf-8 should do the job.

A registration template can be found in section 5.6

@satterly
Copy link

IMHO, it should be "application" not "text" because (emphasis added) ...

The "application" media type is to be used for discrete data which do
not fit in any of the other categories, and particularly for data to
be processed by some type of application program. This is
information which must be processed by an application before it is
viewable or usable by a user.

That it is utf-8 encoded (and mostly human readable) is neither here nor there. It is designed to be consumed by an application, though it can be understood by humans just as JSON or XML can.

XML is an good comparison because the XML mime type RFC defines three mime types ("application/xml", "application/xml-external-parsed-entity", and "application/xml-dtd") and they explicitly state in the introduction that "text/xml" is only an alias to the "application/xml" mime type.

@RichiH
Copy link
Member Author

RichiH commented Sep 15, 2018 via email

@hollodotme
Copy link

Fair points, @satterly.
Sorry, didn't read the application section careful enough.

@SuperQ
Copy link
Member

SuperQ commented Sep 15, 2018

@satterly Thanks, application/xml is a great example.

What about application/openmetrics-text, to differentiate it from say application/openmetrics-proto.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants