[ 
https://issues.apache.org/jira/browse/IGNITE-14376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17371531#comment-17371531
 ] 

Dmitry Pavlov edited comment on IGNITE-14376 at 6/29/21, 5:10 PM:
------------------------------------------------------------------

Folks, I can't find any commit at master for that issue fix.

How the PR was closed? Who committed code fix to master? 

I suggest using apply_pull_request.sh or GitHub integration. Both ways will 
provide reference from the PR to master commit automattically. If none of ways 
were used here, I suggest adding a reference to master commit manually to the 
ticked and to PR



was (Author: dpavlov):
Folks, I can't find any commit at master for that fix.

How the PR was closed? Who committed that fix? 

I suggest using apply_pull_request.sh or GitHub integration. Both ways will 
provide reference from the PR to master commit. If none of ways were used here, 
I suggest adding a reference to master commit manually to the ticked and to PR


> JmxMetricExporter fails to export discovery metrics
> ---------------------------------------------------
>
>                 Key: IGNITE-14376
>                 URL: https://issues.apache.org/jira/browse/IGNITE-14376
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Mikhail Petrov
>            Assignee: Mikhail Petrov
>            Priority: Major
>             Fix For: 2.11
>
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> Error:
> {code:java}
> java.lang.StringIndexOutOfBoundsException: String index out of range: -2
>       at java.lang.String.substring(String.java:1931)
>       at 
> org.apache.ignite.spi.metric.jmx.MetricRegistryMBean.lambda$getMBeanInfo$0(MetricRegistryMBean.java:105)
>       at java.util.Iterator.forEachRemaining(Iterator.java:116)
>       at 
> org.apache.ignite.spi.metric.jmx.MetricRegistryMBean.getMBeanInfo(MetricRegistryMBean.java:85)
>       at 
> org.apache.ignite.spi.metric.jmx.MetricRegistryMBean.getAttribute(MetricRegistryMBean.java:58)
>       at 
> com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getAttribute(DefaultMBeanServerInterceptor.java:647)
>       at 
> com.sun.jmx.mbeanserver.JmxMBeanServer.getAttribute(JmxMBeanServer.java:678)
>       at 
> javax.management.MBeanServerInvocationHandler.invoke(MBeanServerInvocationHandler.java:273)
>       at com.sun.proxy.$Proxy32.getMBeanInfo(Unknown Source)
>       at 
> org.apache.ignite.internal.metric.JmxExporterSpiTest.test(JmxExporterSpiTest.java:146)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>       at java.lang.reflect.Method.invoke(Method.java:498)
>       at 
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
>       at 
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
>       at 
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
>       at 
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
>       at 
> org.apache.ignite.testframework.junits.GridAbstractTest$7.run(GridAbstractTest.java:2391)
>       at java.lang.Thread.run(Thread.java:748)
> {code}
> Reproducer: 
> {code:java}
> /** {@inheritDoc} */
> @Override protected IgniteConfiguration getConfiguration(String 
> igniteInstanceName) throws Exception {
>     IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
>     JmxMetricExporterSpi jmxSpi = new JmxMetricExporterSpi();
>     cfg.setMetricExporterSpi(jmxSpi);
>     return cfg;
> }
> /** */
> @Test
> public void test() throws Exception {
>     IgniteEx srv = startGrid();
>     DynamicMBean mBean = metricRegistry(srv.name(), "io", "discovery");
>     mBean.getMBeanInfo();
> }
> {code}
> The main reason: JMX exporter assumes that each metric must starts with the 
> name of the registry  it belongs to (see MetricRegistryMBean#getMBeanInfo), 
> but discovery metrics do not obey this naming convection (see 
> TcpDiscoveryStatistics/ZookeeperDiscoveryStatistics).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to