[ 
https://issues.apache.org/jira/browse/IGNITE-13342?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

YuJue Li updated IGNITE-13342:
------------------------------
    Fix Version/s: 2.16

> 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
>             Fix For: 2.16
>
>
> 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.20.10#820010)

Reply via email to