willholley opened a new pull request, #5793: URL: https://github.com/apache/couchdb/pull/5793
## Overview ### Why Previously, the `_node/_local/_prometheus` endpoints would return invalid annotations for certain metrics. For example: ``` # TYPE couchdb_database_reads_total counterof times a document was read from a database couchdb_database_reads_total 2208 ``` In general this doesn't matter too much - prometheus will infer the type from the metric name - but some clients will respect it and generate errors/warnings if the annotations are incorrect. ### What This removes the carriage returns from the prometheus output. These were added as an incorrect fix to spurious newlines in the output but caused this bug with the annotations. The actual bug causing the additional newlines is that the result of `type_def/3` was additionally wrapped in a list. This commit removes the re-wrapping. removes the carriage return and adds a test for the output. This changes the output of `to_prom` slightly because the first element of the result is no longer ## Testing recommendations ``` ./dev/run curl http://localhost:15984/_node/_local/_prometheus ``` ## Related Issues or Pull Requests <!-- If your changes affect multiple components in different repositories please put links to those issues or pull requests here. --> ## Checklist - [ ] Code is written and works correctly - [ ] Changes are covered by tests - [ ] Any new configurable parameters are documented in `rel/overlay/etc/default.ini` - [ ] Documentation changes were made in the `src/docs` folder - [ ] Documentation changes were backported (separated PR) to affected branches -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
