[
https://issues.apache.org/jira/browse/IGNITE-13342?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17173692#comment-17173692
]
Eiichi Sato commented on IGNITE-13342:
--------------------------------------
I found another problem in the MBean. The "views" attribute reports
CompositeData type, while actual value returned is TabularData.
[https://github.com/apache/ignite/blob/2a85925f1705fbad36b5421c0ca5cf9de9a29658/modules/core/src/main/java/org/apache/ignite/spi/systemview/jmx/SystemViewMBean.java#L180]
This line should use sysViewType, not rowType.
> DynamicMBean#getAttributes() should return a list of Attributes, not Objects
> ----------------------------------------------------------------------------
>
> Key: IGNITE-13342
> URL: https://issues.apache.org/jira/browse/IGNITE-13342
> Project: Ignite
> Issue Type: Improvement
> Affects Versions: 2.8.1
> Reporter: Eiichi Sato
> Priority: Minor
>
> Currently, calling #getAttributes() on MBeans such as
> `org.apache:clsLdr=18b4aac2,group=views,name="sql.queries"` returns an
> AttributeList directly containing raw attribute values, not
> javax.management.Attribute.
>
> [https://github.com/apache/ignite/blob/77d21eaa367ea293233078e85ed0c967dc2b6ee7/modules/core/src/main/java/org/apache/ignite/spi/metric/jmx/ReadOnlyDynamicMBean.java#L66]
>
> According to the javadoc of AttributeList, this is "highly discouraged".
> > For compatibility reasons, it is possible, though highly discouraged, to
> add objects to an {{AttributeList}} that are not instances of {{Attribute}}.
>
> [https://docs.oracle.com/javase/8/docs/api/javax/management/AttributeList.html]
>
> Also, this behavior seems to cause jmx_exporter to fail due to
> AttributeList#asList() throwing an IllegalArgumentException when
> non-Attribute element is found.
> [https://github.com/prometheus/jmx_exporter/issues/483]
> [https://github.com/prometheus/jmx_exporter/issues/501]
>
> I wouldn't call this a bug, but it'd be better if Ignite can simply wrap raw
> attribute values by Attribute class. I'm going to write a patch and send a PR
> on GitHub.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)