# Create a metric with JMX Operations return value

**URL:** <https://community.dynatrace.com/t/create-a-metric-with-jmx-operations-return-value/47247>\
**Category:** Open Q&A\
**Tags:** dynatrace-managed, jmx\
**Created:** [August 21, 2024, 5:47pm UTC](https://community.dynatrace.com/t/create-a-metric-with-jmx-operations-return-value/47247 "2024-08-21T17:47:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dynaNoob](https://avatars.discourse-cdn.com/v4/letter/d/a698b9/32.png) [@dynaNoob](https://community.dynatrace.com/u/dynaNoob)\
**Post date:** [August 21, 2024, 5:47pm UTC](https://community.dynatrace.com/t/create-a-metric-with-jmx-operations-return-value/47247/1 "2024-08-21T17:47:00Z")

</div>

I have a mbean operation which based on passed string values (2 count) will return a numeric value. I want to collect the returned numeric value to create a metric

com.abc:type=TrackedValues has a JMX Operation&nbsp;getAverage(“A”,“B”) which returns a numeric value

---

<div class="post-metadata">

**Author:** ![jaume\_reverte](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/jaume_reverte/32/1479_2.png) [@jaume\_reverte](https://community.dynatrace.com/u/jaume_reverte)\
**Post date:** [August 22, 2024, 1:44pm UTC](https://community.dynatrace.com/t/create-a-metric-with-jmx-operations-return-value/47247/2 "2024-08-22T13:44:03Z")

</div>

Hello Dynanoob,

The only way I know it is possible to capture this information inside Dynatrace is by creating a JMX extension that will let you inject this as a metric inside Dynatrace.

Creating an Extension for it is pretty easy with the 2.0 framework and&nbsp;[link](https://docs.dynatrace.com/docs/extend-dynatrace/extensions20/data-sources/jmx#jmx-extension-yaml-file)&nbsp;to the documentation.&nbsp;I recommend you to watch [this video](https://www.youtube.com/watch?v=KaLQhLmjP1o). It is an excellent demo of how to perform what you need.

Hope you a good monitoring! In no time, you’ll become dynaPro!
