Last active
August 8, 2023 08:29
-
-
Save franzwong/73cc1861bd4c75b35778c15fcc36cea9 to your computer and use it in GitHub Desktop.
example of prometheus kdb exporter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/ Usage: rlwrap q main.q -p 8080 | |
/ Metrics can be viewed at http://localhost:8080/metrics | |
/ extract.q can be downloaded in https://github.com/KxSystems/prometheus-kdb-exporter | |
system"l /src/prometheus-kdb-test/lib/extract.q" | |
labelkeys:`city | |
labelvalues:enlist "Tokyo" | |
.prom.newmetric[`temperature;`gauge;labelkeys;"Temperature"] | |
temp:.prom.addmetric[`temperature;labelvalues;();33] | |
.prom.on_poll:{[msg] | |
.prom.updval[temp;:;first 30 + 1?10];} | |
.prom.init[] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment