# How does JMX2.0 extension matches the JMX metric name to internal metric name

**URL:** <https://community.dynatrace.com/t/how-does-jmx2-0-extension-matches-the-jmx-metric-name-to-internal-metric-name/46412>\
**Category:** Extensions\
**Tags:** jmx, extensions\
**Created:** [July 2, 2024, 11:10am UTC](https://community.dynatrace.com/t/how-does-jmx2-0-extension-matches-the-jmx-metric-name-to-internal-metric-name/46412 "2024-07-02T11:10:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abhay\_SAP](https://avatars.discourse-cdn.com/v4/letter/a/e56c9b/32.png) [@Abhay\_SAP](https://community.dynatrace.com/u/Abhay_SAP)\
**Post date:** [July 2, 2024, 11:10am UTC](https://community.dynatrace.com/t/how-does-jmx2-0-extension-matches-the-jmx-metric-name-to-internal-metric-name/46412/1 "2024-07-02T11:10:18Z")

</div>

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:  
&nbsp; - key: **cpi.it-gb.gb.request**  
&nbsp; metadata:  
&nbsp; &nbsp; displayName: IT-GB Total Request Count  
&nbsp; &nbsp; description: IT-GB Total Request Count  
&nbsp; &nbsp; unit: Count  
&nbsp; &nbsp; sourceEntityType: process\_group\_instance  
&nbsp; &nbsp; tags:  
&nbsp; &nbsp; &nbsp; - JMX

The dynatrace shows the metric properly.

My question is how is " **cpi.it-gb.gb.request"** &nbsp;mapped to “ **gb.request.count** ”?

Thanks,

Abhay  
[extension\_for\_query.txt](https://community.dynatrace.com/uploads/short-url/agca6PRw4Ol3TeEeBRvCjQnmOV7.txt) (2.04 KB)

---

<div class="post-metadata">

**Author:** ![Mike\_L](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mike_l/32/11717_2.png) [@Mike\_L](https://community.dynatrace.com/u/Mike_L)\
**Post date:** [July 2, 2024, 11:20am UTC](https://community.dynatrace.com/t/how-does-jmx2-0-extension-matches-the-jmx-metric-name-to-internal-metric-name/46412/2 "2024-07-02T11:20:55Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Abhay\_SAP](https://avatars.discourse-cdn.com/v4/letter/a/e56c9b/32.png) [@Abhay\_SAP](https://community.dynatrace.com/u/Abhay_SAP)\
**Post date:** [July 2, 2024, 11:37am UTC](https://community.dynatrace.com/t/how-does-jmx2-0-extension-matches-the-jmx-metric-name-to-internal-metric-name/46412/3 "2024-07-02T11:37:55Z")

</div>

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"** &nbsp;and the extension file does not have this name anywhere. extension has " **cpi.it-gb.gb.request".** &nbsp;I am failing to understand how does dynatrace maps&nbsp; **cpi.it-gb.gb.request** to&nbsp; **gb.request.count** &nbsp;and display the metric.

Thanks,

Abhay

---

<div class="post-metadata">

**Author:** ![Mike\_L](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mike_l/32/11717_2.png) [@Mike\_L](https://community.dynatrace.com/u/Mike_L)\
**Post date:** [July 4, 2024, 3:54pm UTC](https://community.dynatrace.com/t/how-does-jmx2-0-extension-matches-the-jmx-metric-name-to-internal-metric-name/46412/4 "2024-07-04T15:54:38Z")

</div>

Inside your yaml you have this section. We fetch the Count attribute from the JMX query you have defined under “query”:

```markup
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

```
