Set box.cfg table value via env vars
Open
Nobody has claimed this yet.
- Dominant language
- CSS
- Stars
- 15
- Forks
- 49
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 3
Description
This patch implements a way to set tables as box.cfg options value in
two different ways:
- as plain key-value table:
bash> export TT_LOG_MODULES=aaa=info,bbb=error && ./tarantool
Tarantool 2.10.0-beta1-1977-g2970bd57a
type 'help' for interactive help
tarantool> box.cfg{}
...
2023-04-11 07:22:10.951 [219020] main/103/interactive/box.load_cfg I> set \
'log_modules' configuration option to {"aaa":"info","bbb":"error"}
---
...
tarantool> box.cfg.log_modules.aaa
---
- info
...
tarantool> box.cfg.log_modules.bbb
---
- error
...
- as a table in json encoding (important: don't forget to put env var
value into single quotes):
NO_WRAP
bash> export TT_METRICS='{"labels":{"alias":"mystorage"},"include":"all","exclude":["vinyl"]}' && ./tarantool
Tarantool 2.10.0-beta1-1977-g2970bd57a
type 'help' for interactive help
tarantool> box.cfg{}
...
2023-04-11 07:26:03.635 [219288] main/103/interactive/box.load_cfg I> set \
'metrics' configuration option to {"exclude":["vinyl"],"include":"all",\
"labels":{"alias":"mystorage"}}
---
...
tarantool> box.cfg.metrics.include
---
- all
...
NO_WRAP
Requested by @Lord-KA in https://github.com/tarantool/tarantool/commit/cd58c321bc494d0ccac3350cf373cec6cf0f5fd9.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the box.cfg configuration documentation and locate the section describing environment-variable options. Document both plain key-value tables and JSON-encoded tables, including the examples shown here; done means readers can configure and verify table-valued options through environment variables.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100