| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
| ) | ||
|
|
||
| CONTENT_TYPE_LATEST = 'text/plain; version=0.0.4; charset=utf-8' | ||
| CONTENT_TYPE_PLAIN = 'text/plain; version=0.0.4; charset=utf-8' |
There was a problem hiding this comment.
text/plain v 0.0.4 is not the latest, so I thought it best to rename this
Sorry, something went wrong.
There was a problem hiding this comment.
Though I agree with you, this will be a breaking change as other programs use CONTENT_TYPE_LATEST. Perhaps we should update this to version=1.0.0 instead?
Sorry, something went wrong.
There was a problem hiding this comment.
Since this is needed for compatibility, but LATEST and PLAIN are both really different versions of PLAIN that is confusing for external users to use. I'd propose a couple options:
Sorry, something went wrong.
There was a problem hiding this comment.
I like option 2
Sorry, something went wrong.
|
TODO need more openmetrics/exposition tests |
Sorry, something went wrong.
| ) | ||
|
|
||
| CONTENT_TYPE_LATEST = 'text/plain; version=0.0.4; charset=utf-8' | ||
| CONTENT_TYPE_PLAIN = 'text/plain; version=0.0.4; charset=utf-8' |
There was a problem hiding this comment.
Though I agree with you, this will be a breaking change as other programs use CONTENT_TYPE_LATEST. Perhaps we should update this to version=1.0.0 instead?
Sorry, something went wrong.
There was a problem hiding this comment.
Is this used anywhere? Or just a nice example for testing locally?
Sorry, something went wrong.
There was a problem hiding this comment.
just for testing locally
Sorry, something went wrong.
There was a problem hiding this comment.
but is also pretty nice for people to get off the ground
Sorry, something went wrong.
we do still need a 0.0.4 constant as the fallback when all else fails. What I could do is update LATEST to be 1.0.0 and then create the new PLAIN constant for 0.0.4 |
Sorry, something went wrong.
There was a problem hiding this comment.
Generally looks to be getting there! A few comments mostly around the content types still. CONTENT_TYPE_LATEST from just exposition.py (not open metrics) doesn't actually seem to be used?
Sorry, something went wrong.
| ) | ||
|
|
||
| CONTENT_TYPE_LATEST = 'text/plain; version=0.0.4; charset=utf-8' | ||
| CONTENT_TYPE_PLAIN = 'text/plain; version=0.0.4; charset=utf-8' |
There was a problem hiding this comment.
Since this is needed for compatibility, but LATEST and PLAIN are both really different versions of PLAIN that is confusing for external users to use. I'd propose a couple options:
Sorry, something went wrong.
There was a problem hiding this comment.
When everything is specified it seems to work well, though I ran into a few edge cases that need fixes and testing.
Sorry, something went wrong.
|
I ended up not using mocks, a simple regex check feels robust enough to confirm correctness. |
Sorry, something went wrong.
There was a problem hiding this comment.
👍 Thanks! Tested it for a bit and it is working well for me. There are some test changes where generate_latest now takes an escaping that isn't necessary now that there is a default value, but I am not opposed to passing in explicit values either.
Sorry, something went wrong.
Part of #1013 Signed-off-by: Owen Williams <owen.williams@grafana.com>
| Back | FazBrowse Home | New Git URL |
Part of #1013
The remaining piece is configuration to force escaping even if a scraper does not request it