# How to instrument methods to get timing

**URL:** <https://community.dynatrace.com/t/how-to-instrument-methods-to-get-timing/18609>\
**Category:** Open Q&A\
**Tags:** distributed-traces-classic\
**Created:** [November 28, 2018, 4:13pm UTC](https://community.dynatrace.com/t/how-to-instrument-methods-to-get-timing/18609 "2018-11-28T16:13:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![alejandro\_herna](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/alejandro_herna/32/10062_2.png) [@alejandro\_herna](https://community.dynatrace.com/u/alejandro_herna)\
**Post date:** [November 28, 2018, 4:13pm UTC](https://community.dynatrace.com/t/how-to-instrument-methods-to-get-timing/18609/1 "2018-11-28T16:13:09Z")

</div>

When looking at stack frames on purepaths we notice that it doesn’t display timing information for methods because they are not instrumented:

 ![18983-methods.jpg](https://global.discourse-cdn.com/dynatrace/original/2X/c/c0fd07a9de268931f7678eaedb4fa1ba46455fed.jpeg)

_This is just a sample, these are not the methods we would like to instrument._

How can we instrument them so we get timing information?

---

<div class="post-metadata">

**Author:** ![skrystosik](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/skrystosik/32/21133_2.png) [@skrystosik](https://community.dynatrace.com/u/skrystosik)\
**Post date:** [November 28, 2018, 5:08pm UTC](https://community.dynatrace.com/t/how-to-instrument-methods-to-get-timing/18609/2 "2018-11-28T17:08:23Z")

</div>

For now there are two options I think, one is creating custom service based on those methods, second is creating request attribute (the method has to be instrumented to provide argument or return value, so timings should also be available. For now I think there is no option to instrument method just for timings.

Regards,  
Sebastian

---

<div class="post-metadata">

**Author:** ![kristopher\_sarp](https://avatars.discourse-cdn.com/v4/letter/k/73ab20/32.png) [@kristopher\_sarp](https://community.dynatrace.com/u/kristopher_sarp)\
**Post date:** [May 2, 2022, 7:53pm UTC](https://community.dynatrace.com/t/how-to-instrument-methods-to-get-timing/18609/3 "2022-05-02T19:53:13Z")

</div>

Three years later…is it still not possible to get method timings?

---

<div class="post-metadata">

**Author:** ![theharithsa](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/theharithsa/32/16236_2.png) [@theharithsa](https://community.dynatrace.com/u/theharithsa)\
**Post date:** [May 3, 2022, 12:42am UTC](https://community.dynatrace.com/t/how-to-instrument-methods-to-get-timing/18609/4 "2022-05-03T00:42:23Z")

</div>

Hi&nbsp;[@kristopher\_sarp](https://community.dynatrace.com/user/22257)&nbsp;  
We get this from many paces. As you might know, there is an option to instrument methods via OneAgent SDK feature which will give you timing information as you are expecting. You can instrument the method using SDK and then you can get the timing details for it.

---

<div class="post-metadata">

**Author:** ![harald\_berger](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/harald_berger/32/31754_2.png) [@harald\_berger](https://community.dynatrace.com/u/harald_berger)\
**Post date:** [May 3, 2022, 11:30am UTC](https://community.dynatrace.com/t/how-to-instrument-methods-to-get-timing/18609/5 "2022-05-03T11:30:06Z")

</div>

Hi,

Sebastian is right. Customer services are the way to go here. They were exactly built for this, to get timings for methods that are not covered by out-of-the-box sensors.

Best

Harry
