# How to capture the return value of a method?

**URL:** <https://community.dynatrace.com/t/how-to-capture-the-return-value-of-a-method/16937>\
**Category:** Open Q&A\
**Tags:** request-attributes, java\
**Created:** [November 9, 2018, 2:36pm UTC](https://community.dynatrace.com/t/how-to-capture-the-return-value-of-a-method/16937 "2018-11-09T14:36:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fousseyni\_bouar](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/fousseyni_bouar/32/10808_2.png) [@fousseyni\_bouar](https://community.dynatrace.com/u/fousseyni_bouar)\
**Post date:** [November 9, 2018, 2:36pm UTC](https://community.dynatrace.com/t/how-to-capture-the-return-value-of-a-method/16937/1 "2018-11-09T14:36:27Z")

</div>

Hello,

Is it possible to capture the return value of a Java method in Dynatrace?

Best Regards,

Fousseyni B.

---

<div class="post-metadata">

**Author:** ![Joe\_Hoffman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/joe_hoffman/32/30752_2.png) [@Joe\_Hoffman](https://community.dynatrace.com/u/Joe_Hoffman)\
**Post date:** [November 9, 2018, 3:53pm UTC](https://community.dynatrace.com/t/how-to-capture-the-return-value-of-a-method/16937/2 "2018-11-09T15:53:29Z")

</div>

Yes you can.

Settings → Server Side Service Monitoring → Request Attributes.

Create a new Request Attribute and in the Data Source section, specify “Java Method Parameters”.

Once you’ve defined the class.method, you will be provided a pulldown to choose the ‘Return Value’ value of the specified method.

Here’s the doc page which describes this feature. [https://www.dynatrace.com/support/help/monitor/tra…](https://www.dynatrace.com/support/help/monitor/transactions-and-services/request-attributes/numerical-values-aggregations-and-deep-object-access/)
