6 Commits

Author SHA1 Message Date
Alberto Bertogli
5cdbd9ff6e Fix documentation/comment typos
This patch fixes a variety of typos in documentation and comments, found
by running `codespell`.
2023-10-07 12:41:57 +01:00
Alberto Bertogli
3ebe5c5173 Replace uses of ioutil
ioutil package was deprecated in Go 1.16, replace all uses with their
respective replacements.

This patch was generated with a combination of `gofmt -r`, `eg`, and
manually (for `ioutil.ReadDir`).
2022-11-12 20:06:35 +00:00
Alberto Bertogli
e85c31782b Fix misc. linter issues (comments, variable naming, etc.)
We've accumulated a few linter issues around comments and a couple of
variable names.

While none of them is major, this patch cleans them up so it's easier to
go through the linter output, and we can start being more strict about
it.
2022-08-27 23:49:33 +01:00
Alberto Bertogli
099e2e2269 expvarom: Use application/openmetrics-text as content type
The openmetrics proposed standard says we should use the
`application/openmetrics-text` content type when exporting the metrics.

Currently we use `text/plain` for backwards compatibility with
Prometheus, but the new content type is apparently supported since 2018,
so it should be safe to update to match the current proposed standard.
2021-06-11 12:48:45 +01:00
Alberto Bertogli
34b1f6cf21 expvarom: Add EOF marker, and minor documentation updates
This patch adds the EOF marker as required by the new specification, and
also adds some links to it in the comments, as reference.
2021-01-16 13:08:46 +00:00
Alberto Bertogli
7fe42a368a monitoring: Add OpenMetrics exporter
This patch makes chasquid's monitoring server expose an OpenMetrics
metrics endpoint.

It adds a new package "expvarom" which implements an HTTP handler that
exports expvar variables in the OpenMetrics text format.

Then, the handler is registered by the monitoring server at /metrics
(where most things expect it to be).

The existing exported variables are also extended with descriptions,
which is optional, but improves the readability of the metrics.
2020-08-21 12:07:33 +01:00