jmxtrans / jmxtrans-agent

Java Agent based JMX metrics exporter.
MIT License
179 stars 110 forks source link

Support for different collect intervals #56

Closed kerlandsson closed 8 years ago

kerlandsson commented 8 years ago

We would like to collect some of our metrics more frequently than others. Hence we would like support for specifying different collect intervals.

If we can agree on how it should work we are prepared to implement it. The most simple solution I see is to allow for an override on query and invocation elements:

<query objectName="java.lang:type=Threading" attribute="ThreadCount" resultAlias="jvm.thread"
  collectIntervalInSeconds="10"/>

This override would be used when specified. The default would be used for queries which do not have an override.

Another option would to add support for groups of queries/invocations where some configuration parameters could be overridden on group level. Something like:

<queries>
  <group name="foo">
    <query ... />
    <invocation ... />
    <collectIntervalInSeconds>10</collectIntervalInSeconds>
  </group>
  <group name="bar">
  ...
  </group>
  <!-- defaults -->
  <collectIntervalInSeconds>20</collectIntervalInSeconds>
</queries>

While I can see the benefits of groups in overriding other parameters (e.g. distinct output writers per group), it is a larger change which adds a bit of complexity.

Any thoughts on this?

kerlandsson commented 8 years ago

@cyrille-leclerc I am probably going to work on this shortly. What are your thoughts? I'm leaning towards supporting a collectIntervalInSeconds override on query/invocation elements.

cyrille-leclerc commented 8 years ago

Thanks!

FYI I am working on introducing the Resource API (HTTP, Classpath & File System).

Cyrille

On Thu, Feb 4, 2016 at 4:22 PM, Kristoffer Erlandsson < notifications@github.com> wrote:

@cyrille-leclerc https://github.com/cyrille-leclerc I am probably going to work on this shortly. What are your thoughts? I'm leaning towards supporting a collectIntervalInSeconds override on query/invocation elements.

— Reply to this email directly or view it on GitHub https://github.com/jmxtrans/jmxtrans-agent/issues/56#issuecomment-179896752 .

Cyrille Le Clerc email & gtalk : cleclerc@cloudbees.com / mob: +33-6.61.33.69.86 / skype: cyrille.leclerc CloudBees, Inc www.cloudbees.com

kerlandsson commented 8 years ago

Implemented in 1.2.3.