New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(config-endpoint): add initial implementation #1896
feat(config-endpoint): add initial implementation #1896
Conversation
Hello @killme2008 @sunng87 @MichaelScofield @waynexia I understand the main challenge is to pass the
|
I prefer toml because it's the format we (the binary) accept 🧐 |
@etolbakov I think |
This config file can be seen as another kind of log. Just like the config printed on start but this file won't go outdated. So I'm ok with this temp file |
Thank you very much for the feedback 👍! Michael, sorry for confusion. As one remarkable programmer told - "Talk is cheap, show me the code", so I put a bit more details to support my initial idea. Could you please take a look when you have time? Here's how it works at the moment. The created file: ❯ ls -lah /tmp/greptimedb/conf
drwxr-xr-x 3 etolbakov wheel 96B 6 Jul 14:45 .
drwxr-xr-x 8 etolbakov wheel 256B 6 Jul 15:04 ..
-rw-r--r-- 1 etolbakov wheel 1.8K 6 Jul 15:04 opts.toml The app start log:
Endpoint invocation example:
Happy to proceed with adding tests and putting it under admin api if there are no major reservations with this approach. |
@etolbakov I see, so you are generating a static file from config at the start of running GreptimeDB, and reading it back to user in http text when |
@MichaelScofield, thank you very much for the feedback! |
@MichaelScofield @waynexia |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, thanks
* feat(config-endpoint): add initial implementation * feat: add initial handler implementation * fix: apply clippy suggestions, use axum response instead of string * feat: address CR suggestions * fix: minor adjustments in formatting * fix: add a test * feat: add to_toml_string method to options * fix: adjust the assertion for the integration test * fix: adjust expected indents * fix: adjust assertion for the integration test * fix: improve according to clippy
I hereby agree to the terms of the GreptimeDB CLA
What's changed and what's your intention?
add
/config
API endpoint to retrieve the current configuration(Options) that were used for the app to startPlease explain IN DETAIL what the changes are in this PR and why they are needed:
Checklist
Refer to a related PR or issue link
#1793