qbittorrent-exporter
qbittorrent-exporter copied to clipboard
Migrate to quarkus and add locale setting
Fixes: https://github.com/caseyscarborough/qbittorrent-exporter/issues/19 & https://github.com/caseyscarborough/qbittorrent-exporter/issues/15
Locale setting is defined in Environment variable: QBITTORRENT_LOCALE
, defaults to en-US
, uses IETF BCP 47 language tag (also see RFC 4647 "Matching of Language Tags" and RFC 5646 "Tags for Identifying Languages").
To review:
- [ ] Implications in using quarkus and compiling to native code
- [ ] Documentation update for environment variable
Seems like #15 is not completely fixed, at least not on my end. Changed locale to nl-NL
to match qBit but the resulting values simply remove the comma entirely (e.g. 10,90
becomes 1090
). Same thing seems to happen with fr-FR
, which you recommended in the issue.
Hello @Quinten0508 , appreciate your effort for testing it!
Can you also check and/or provide screenshot if the value for Global Ratio reflects the same in prometheus when querying it with promql directly? Grafana or Prometheus screenshot will do, see below for example, or can also call on the exporter's /metrics
endpoint directly and provide the output here.
~I have a suspicion that some parts like individual torrent ratios are still not fixed~ this seems to be not the issue, just wanted to check if at least the Global ratio is fixed. Will push updates on this PR if it seems to be the issue
Can confirm, global ratio is also wrong within Prometheus. Real share ratio should be 10,90
(or 10.90
). Same goes for the /metrics
endpoint. In the second screenshot you can see it does add a decimal dot, just not in the right spot (1090.0
instead of 10.90
)
Might be worth noting that within the docker container's logs, the following error keeps showing up every time it scrapes new data: 2023-11-04 14:48:18,858 WARN [qbi.api.gso.LongTypeAdapter] (executor-thread-1) Could not read long None which had an invalid long value. Defaulting value to 0.
Not sure if this has to do with the global ratio conversion or if it's completely unrelated. Setting the env variable LOG_LEVEL=DEBUG
does not do anything.
I've opened an issue with the upstream framework, might be an issue caused by Quarkus/GraalVM native. This might be caused by upstream not by the code itself. https://github.com/quarkusio/quarkus/issues/36876
Hi @Quinten0508
I've made some workarounds to issues with the framework, please pull the latest image (vincejv/qbittorrent-exporter
), I personally tested it on my end as well by manually changing the locales. Thanks.
Just pulled the latest image and it seems to be working now! Thanks :D
Holding off as draft until Quarkus ~3.7~ 3.8, which is an LTS release. But this PR has been stable so far after 3 months of usage, no OOM crashes or errors, no regressions in correctness/performance. Resource usage is consistent on earlier posts, 20-50mb RAM idle compared to pure JVM.