Skip to content
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

support for including configuration from multiple files #15

Open
dpocock opened this issue Mar 17, 2014 · 2 comments
Open

support for including configuration from multiple files #15

dpocock opened this issue Mar 17, 2014 · 2 comments

Comments

@dpocock
Copy link
Member

dpocock commented Mar 17, 2014

Currently, JMXetric is configured by jmxetric.xml

It would be useful if jmxetric.xml could source metrics from additional XML files and merge all the attribute definitions.

This would enable sharing config fragments between several JVMs on the same host.

@ngzhian
Copy link
Contributor

ngzhian commented May 26, 2014

I can think of 2 ways that multiple XML files can be specified:

  1. on the arguments passed into the agent -javaagent:jmxetric-1.0.4.jar=$args
    where args=config=etc/jmxetric.xml:etc/anotherFile.xml
  2. as a node in the XML file, maybe like how a <link> tag works in HTML. It could look like this <link src="etc/anotherFile.xml">, and anotherFile.xml will be parsed for samples.

2 seems to be a good option, but how do we resolve the issue that 2 XML files specify different <ganglia> configuration? For example if the hostname is different. Or should it be restricted to only specifying samples?

@ngzhian
Copy link
Contributor

ngzhian commented Jun 11, 2014

I wrote a rough implementation at ngzhian/jmxetric/multiple-xml. Of note is the changes to jmxetric_test.xml to add a new tag link with an attribute src that specifies the location of other XML files to load, which in this case is jmxetric_link.xml.

The relevant code to do this is in JMXetricXmlConfigurationService.
For now, this implementation is based on an my unmerged PR #23, because it is easier to implement it on that.

Also, this implementation dictates that jmxetric.xml is the entry point of configuration, and other XML files are limited because they can only configure samples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants