metrico / qryn

⭐️ All-in-One Polyglot Observability with OLAP Storage for Logs, Metrics, Traces & Profiles. Drop-in Grafana Cloud replacement compatible with Loki, Prometheus, Tempo, Pyroscope, Opentelemetry, Datadog and beyond :rocket:
https://qryn.dev
GNU Affero General Public License v3.0
1.19k stars 67 forks source link

Booleans parsed from environment in utterly confusing ways #476

Closed bzed closed 6 months ago

bzed commented 6 months ago

Hi,

there are various "boolean" style config settings, which are parsed in different ways. For example:

https://github.com/metrico/qryn/blob/9da57a75cf666dad92fab1f7a91daecfbf55bbe0/common.js#L104

at least compares the value with 1. Not sure why it needs a lambda, but it works. According to the documentation the default is false, so I would expect the right setting to be 'true' and not 1.

https://github.com/metrico/qryn/blob/9da57a75cf666dad92fab1f7a91daecfbf55bbe0/common.js#L129

Even worse. READONLY=false in the environment will evaluate to true. :crying_cat_face: Basically everywhere if (readonly) is being used.

I did not go trough the other boolean style config options, but please find a unified way to set such options and document it.

Thanks,

Bernd

lmangani commented 6 months ago

Thanks for raising this good point @bzed we need to sanitize bool settings in a standardized fashion. We'll add this to the quick roadmap to improve the experience.

akvlad commented 6 months ago

@bzed the problem you mentioned was... well, taken under control since 3.2.14 all the boolean env vars should be:

I hope the solution satisfies everyone. Thanks for the heads up.

lmangani commented 6 months ago

Closing as completed! Feel free to reopen if the issue persists