-
Notifications
You must be signed in to change notification settings - Fork 107
code cleanup and refactor #1031
Comments
viper supports toml, which is basically a more formally defined (standardized) implementation of ini files. |
I agree that json isn't pleasant to work with. But yaml can be fine, depending on how you layout the file. The thing I like most about viper is that it normalizes the config variable names for you.
is the same as the yaml
which is the same as the toml
I have played around with trying to get viper to parse an ini file. you cant just treat the ini file as a toml file, as ini does not require strings to be quoted, but toml does. So it looks like we should be able to support a transition period where we expect the ini file format by default, but also allow users to use toml, yaml or json by passing a cmdline flag. Then after the transition period we default to using toml, yaml or json and make ini optional via the cmdline flag. And eventually drop support for ini. |
@Dieterbe if you are happy with the architecture changes proposed here, then i think we can formulate a plan of attack. I am thinking we should make the following changes, in this order
|
haven't had time yet to look into all of the architecture changes, but we can start with the switch to logrus (#624) |
some prior discussion re config in #456 |
realistically I won't be able to give this the attention it needs for at least another week of 2, |
came across https://blog.golang.org/wire |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
There are a number of code cleanup initiatives we want to tackle. Config, logging, plugin management.
The plugin-management changes are needed so that we can build metrictank-enterprise versions with more advanced input, index and store plugins (plus any other future features we want to add).
To be able to do that, we need to overhaul how we initialize and share components/plugins.
I have been looking at the Grafana code base and I really like what they have done with self-registering components and dependency injection. I think that is the model we should follow.
I have built a basic POC of how all of the capabilities work together. I have tried to cover all of the use cases that we have in Metrictank. The highlights are:
Trying to update everything to match this architecture in one go is going to be a huge PR, that would be hard to review. But i think we should be able to transition to this architecture in small steps.
The most impactful change is going to be updating how we manage configuration. I have really come to like
github.com/spf13/viper
. Viper doesnt work with INI files, so would need to move to json or yaml. But otherwise i think we can keep the same config names and ENV vars.The text was updated successfully, but these errors were encountered: