Page MenuHomeFreeBSD

ctlstat: add prometheus output
ClosedPublic

Authored by asomers on Apr 21 2021, 11:00 PM.

Details

Summary

When invoked by inetd, ctlstat -P will now produce output suitable for
ingestion into Prometheus.

It's a drop-in replacement for https://github.com/Gandi/ctld_exporter,
except that it doesn't report the number of initiators per target, and
it does report time and dma_time.

MFC after: 2 weeks
Sponsored by: Axcient

Diff Detail

Repository
rG FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

0mp requested changes to this revision.Apr 22 2021, 6:12 AM
0mp added a subscriber: 0mp.

I've got some minor fixes for the manual page.

Also, just an idea: shouldn't we extend libxo with Prometheus support? This way we would have a consistent way of printing this format across various utilities without having to introduce a different flag for each one.

usr.bin/ctlstat/ctlstat.8
89
135
138
This revision now requires changes to proceed.Apr 22 2021, 6:12 AM
asomers marked 2 inline comments as done.
  • Respond to 0mp's man page review
In D29901#671164, @0mp wrote:

I've got some minor fixes for the manual page.

Also, just an idea: shouldn't we extend libxo with Prometheus support? This way we would have a consistent way of printing this format across various utilities without having to introduce a different flag for each one.

That's an interesting idea. I hadn't thought of it. The only problems are that I'm not very familiar with libxo's workings, and ctlstat doesn't support libxo anyway. I admit, I'm not thrilled about the idea of repeating all of this work. But it might be worthwhile. Do you know libxo? What would your proposal entail?

Note: prometheus output is quite specific, I am not sure it is worth trying to add libxo to the party. Having a half backed conversion to libxo just to cover prom sounds weird to me.

bcr added a subscriber: bcr.

Manpage looks good now.

This revision was not accepted when it landed; it landed in state Needs Review.Apr 20 2022, 9:20 PM
This revision was automatically updated to reflect the committed changes.