Thanks Mat. 
Mapping rules alongwith values did work.I used below rules to achieve this
  - pattern: "org.apache.activemq<type=Broker, brokerName= myBroker01 , 
service=Health><>CurrentStatus: Good"
    value: 1
  - pattern: "org.apache.activemq<type=Broker, brokerName= 
myBroker01 , service=Health><>CurrentStatus: *"
    value: 0

On Saturday, March 6, 2021 at 2:05:49 PM UTC+5:30 [email protected] 
wrote:

> The Prometheus data model only has float values (this makes the highly 
> compact storage possible), so the exporter has no way to represent "Good", 
> "Bad", or "lily-of-the-valley" without further help from you.
>
> Can you write a pair of mapping rules for the exporter that match on the 
> possible beanPropertyValue and set a fixed metric value of 1 or 0?
>
> /MR
>
> On Fri, Mar 5, 2021, 18:28 Rip Jal <[email protected]> wrote:
>
>> This looks like to be an issue 
>>
>> I have activemq Mbean which has attribute currentStatus whose value is 
>> returned as Good.
>> Exact MbeanObject is 
>> "org.apache.activemq:type=Broker,brokerName=myBroker01,service=Health"
>> Looks like in JMXCollector.Receiver.recordBean,it is only storing value 
>> if it is a number or Boolean else it is ignoring and returning from there 
>> and then.
>> Below is the code snippet from JMXCollector
>> if (beanValue instanceof Number) { value = ((Number) 
>> beanValue).doubleValue() * matchedRule.valueFactor; } else if (beanValue 
>> instanceof Boolean) { value = (Boolean) beanValue ? 1 : 0; } else { 
>> LOGGER.fine("Ignoring unsupported bean: " + beanName + attrName + ": " + 
>> beanValue); return; }
>>
>> Is there any reason to do so ?Is jmx_exporter not expected to be 
>> returning string ?
>>
>> If there is any alternative to get this metric out?
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Prometheus Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/prometheus-users/1d46ce80-8787-4bfa-8ec8-6e36f6a688e9n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/prometheus-users/1d46ce80-8787-4bfa-8ec8-6e36f6a688e9n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/5ca75f84-98d5-4fab-a8a7-e281476d8375n%40googlegroups.com.

Reply via email to