02 Jul 2024 12:10 PM - last edited on 19 Aug 2024 08:57 AM by Michal_Gebacki
Hi,
I have a CF application which publishes a metric named "gb.request.count" to JMX. My extension.yaml file used in JMX2.0 defines the metric as follows:
metrics:
- key: cpi.it-gb.gb.request
metadata:
displayName: IT-GB Total Request Count
description: IT-GB Total Request Count
unit: Count
sourceEntityType: process_group_instance
tags:
- JMX
The dynatrace shows the metric properly.
My question is how is "cpi.it-gb.gb.request" mapped to "gb.request.count"?
Thanks,
Abhay
Solved! Go to Solution.
02 Jul 2024 12:20 PM - edited 02 Jul 2024 12:21 PM
The snippet you shared is from the metric metadata. This section of the yaml is only responsible for display names and units and such, no matter the source.
Inside your YAML you also have the the JMX section where you give the metric an ID based on the mbean attribute. If you want to rename the ID of the metric and remove "cpi.it-" from the metric ID, that's the easiest place to do that.
If you're just wondering why it added "count" at the end of the metric, that's because you defined this as a count metric in the jmx section of the YAML.
02 Jul 2024 12:37 PM
Hi Mike,
Thank you for the response. I have attached a text file which contains the jmx section too.
My application is pushing the metric to JMX with bean name as "gb.request.count" and the extension file does not have this name anywhere. extension has "cpi.it-gb.gb.request". I am failing to understand how does dynatrace maps cpi.it-gb.gb.request to gb.request.count and display the metric.
Thanks,
Abhay
04 Jul 2024 04:54 PM
Inside your yaml you have this section. We fetch the Count attribute from the JMX query you have defined under "query":
jmx:
groups:
- group: jmx
subgroups:
- subgroup: metrics:name=gbRequestCount.systemId.dummyId,*
query: metrics:name=gbRequestCount.systemId.dummyId,*
metrics:
- key: cpi.it-gb.gb.request
value: attribute:Count
type: gauge
- key: cpi.it-gb.gb.request.count.rate.count
value: attribute:Count
type: count