# Does @CaptureSpan work on private methods?

**URL:** <https://discuss.elastic.co/t/does-capturespan-work-on-private-methods/203492>\
**Category:** APM\
**Tags:** java\
**Created:** [October 14, 2019, 4:43pm UTC](https://discuss.elastic.co/t/does-capturespan-work-on-private-methods/203492 "2019-10-14T16:43:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![OrangeDog](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/orangedog/32/4630_2.png) [@OrangeDog](https://discuss.elastic.co/u/OrangeDog)\
**Post date:** [October 14, 2019, 4:43pm UTC](https://discuss.elastic.co/t/does-capturespan-work-on-private-methods/203492/1 "2019-10-14T16:43:58Z")

</div>

Does the @CaptureSpan annotation work on private methods / internal method invocations, or is it e.g. proxy-based and cannot intercept them?

---

<div class="post-metadata">

**Author:** ![Eyal\_Koren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eyal_koren/32/36830_2.png) [@Eyal\_Koren](https://discuss.elastic.co/u/Eyal_Koren)\
**Post date:** [October 15, 2019, 7:35am UTC](https://discuss.elastic.co/t/does-capturespan-work-on-private-methods/203492/2 "2019-10-15T07:35:35Z")

</div>

Yes, it should work on any method annotated with it, as it works through bytecode instrumentation.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 5, 2019, 3:35am UTC](https://discuss.elastic.co/t/does-capturespan-work-on-private-methods/203492/3 "2019-11-05T03:35:43Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
