Hi everyone,
Yesterday Lukas asked on IRC if there was a discussion about
configuration. AFAIK, there wasn't, hence I'm sharing how we support
configuration in metrics.
# Metrics REST server
The REST server runs on top of Wildfly.
Configuration is a set of key/value pairs (configuration properties)
defined by the following sources, in order of precedence:
* system properties (-Dkey=value)
* external java.util.Properties file, which path is defined by the
metrics.conf system property; by default, <user.home>/.metrics.conf is
used (if it exists)
* internal java.util.Properties file (META-INF/metrics.conf)
The rationale behind is that the system should be able to:
1. start with reasonable defaults
2. switch to another configuration easily
# pTrans
pTrans is different because it's a standalone application, so it's much
easier to follow the daemon configuration habits.
pTrans takes a path to a properties configuration file as a program
argument. This argument is mandatory.
# Configuration file format.
metrics started with properties file and I think it's fine.
But if we feel the need for a more structured format, we should pick
something which can be easily parsed by a variety of programming
languages, especially languages widely used for administration (Python
and Ruby).
Regards,
Thomas