You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Chetan Mehrotra <ch...@gmail.com> on 2016/01/21 06:28:51 UTC

[Metrics] Naming convention for MBeans registered by Sling Metrics

Hi Team,

Per current setup all Metrics MBeans are registered under
"org.apache.sling" domain. Even metrics registered by non Sling bundle
which can lead to confusion.

So we would need to come up with a way to make JMX domain name a
function of bundle which is registering the metric. For that I was
thinking of following approach

1. Expose the MetricService as a ServiceFactory

2. Have an OSGi config which provides a mapping between
    Bundle-SymbolicName and JMX Domain name to use. It
    would be a regex expression. The metric though MUST be
    unique across all metrics (irrespective of which bundle was used)

    --------------
    com.foo = com.foo.*
    org.apache.sling=org.apache.sling.*
    --------------

Where 'com.foo' is the JMX domain name used for all bundle having
there Bundle-Symbolicname confirming to pattern 'com.foo.*'

Thoughts and suggestion welcome!

Chetan Mehrotra

Re: [Metrics] Naming convention for MBeans registered by Sling Metrics

Posted by Chetan Mehrotra <ch...@gmail.com>.
> Could those generating the metrics use the full name, rather than expecting
them to be automatically namespaced.?

Note that this proposal is not for namespacing the metric name. Rather
its for the JMX Domain name under which the MBean is registered.

As for actual Metrics name currently its open to developer and if two
different component try to use the same name then first one would win
and for other an exception would be thrown.
Chetan Mehrotra


On Thu, Jan 21, 2016 at 7:28 PM, Ian Boston <ie...@tfd.co.uk> wrote:
> Hi,
> Could those generating the metrics use the full name, rather than expecting
> them to be automatically namespaced.?
> Rather like the way the Logger classes make no assumptions.
> That would be simpler, but perhaps more work for the developer.
> Best Regards
> Ian
>
> On 21 January 2016 at 05:28, Chetan Mehrotra <ch...@gmail.com>
> wrote:
>
>> Hi Team,
>>
>> Per current setup all Metrics MBeans are registered under
>> "org.apache.sling" domain. Even metrics registered by non Sling bundle
>> which can lead to confusion.
>>
>> So we would need to come up with a way to make JMX domain name a
>> function of bundle which is registering the metric. For that I was
>> thinking of following approach
>>
>> 1. Expose the MetricService as a ServiceFactory
>>
>> 2. Have an OSGi config which provides a mapping between
>>     Bundle-SymbolicName and JMX Domain name to use. It
>>     would be a regex expression. The metric though MUST be
>>     unique across all metrics (irrespective of which bundle was used)
>>
>>     --------------
>>     com.foo = com.foo.*
>>     org.apache.sling=org.apache.sling.*
>>     --------------
>>
>> Where 'com.foo' is the JMX domain name used for all bundle having
>> there Bundle-Symbolicname confirming to pattern 'com.foo.*'
>>
>> Thoughts and suggestion welcome!
>>
>> Chetan Mehrotra
>>

Re: [Metrics] Naming convention for MBeans registered by Sling Metrics

Posted by Ian Boston <ie...@tfd.co.uk>.
Hi,
Could those generating the metrics use the full name, rather than expecting
them to be automatically namespaced.?
Rather like the way the Logger classes make no assumptions.
That would be simpler, but perhaps more work for the developer.
Best Regards
Ian

On 21 January 2016 at 05:28, Chetan Mehrotra <ch...@gmail.com>
wrote:

> Hi Team,
>
> Per current setup all Metrics MBeans are registered under
> "org.apache.sling" domain. Even metrics registered by non Sling bundle
> which can lead to confusion.
>
> So we would need to come up with a way to make JMX domain name a
> function of bundle which is registering the metric. For that I was
> thinking of following approach
>
> 1. Expose the MetricService as a ServiceFactory
>
> 2. Have an OSGi config which provides a mapping between
>     Bundle-SymbolicName and JMX Domain name to use. It
>     would be a regex expression. The metric though MUST be
>     unique across all metrics (irrespective of which bundle was used)
>
>     --------------
>     com.foo = com.foo.*
>     org.apache.sling=org.apache.sling.*
>     --------------
>
> Where 'com.foo' is the JMX domain name used for all bundle having
> there Bundle-Symbolicname confirming to pattern 'com.foo.*'
>
> Thoughts and suggestion welcome!
>
> Chetan Mehrotra
>