# Update Context or Transaction Result in Java Public API

**URL:** <https://discuss.elastic.co/t/update-context-or-transaction-result-in-java-public-api/155622>\
**Category:** APM\
**Created:** [November 6, 2018, 8:49pm UTC](https://discuss.elastic.co/t/update-context-or-transaction-result-in-java-public-api/155622 "2018-11-06T20:49:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ngourley](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ngourley/32/37350_2.png) [@ngourley](https://discuss.elastic.co/u/ngourley)\
**Post date:** [November 6, 2018, 8:49pm UTC](https://discuss.elastic.co/t/update-context-or-transaction-result-in-java-public-api/155622/1 "2018-11-06T20:49:04Z")

</div>

There are no methods for setting transaction.result or context.request.url.full. These fields are displayed in the APM Dashboard as "URL" and "Result" for sample transactions.

I am using sparkjava for a webservice which is not supported, so I believe that the public api is my only option, but it would be nice to set these fields.

Any ideas?

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [November 9, 2018, 4:07pm UTC](https://discuss.elastic.co/t/update-context-or-transaction-result-in-java-public-api/155622/2 "2018-11-09T16:07:48Z")

</div>

Hi and thanks for your question.

The public API is somewhat limited in scope so that it's easier to maintain backwards compatibility and easier to use/harder to shoot yourself in the foot.

What you can to is to use the setTag method to add the url as a tag to the transaction. That won't show it in the exact same spot but at least you could see it in the tags tab of the UI.

However, I agree that at least there should be a `setResult` method for transactions.

If you want to build a deeper and more sophisticated framework integration including auto-instrumentation you can have a look at the [contributing instructions](https://github.com/elastic/apm-agent-java/blob/master/CONTRIBUTING.md). By doing that, you have full access to the internal API.

I hope that helps 🙂

Cheers,  
Felix

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [November 16, 2018, 2:57pm UTC](https://discuss.elastic.co/t/update-context-or-transaction-result-in-java-public-api/155622/3 "2018-11-16T14:57:25Z")

</div>

Version 1.0 contains a `setResult` method

---

<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:** [December 7, 2018, 10:57am UTC](https://discuss.elastic.co/t/update-context-or-transaction-result-in-java-public-api/155622/4 "2018-12-07T10:57:27Z")

</div>

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