# Java - Request and response data missing when Annotations or using apm-agent-api

**URL:** <https://discuss.elastic.co/t/java-request-and-response-data-missing-when-annotations-or-using-apm-agent-api/175843>\
**Category:** APM\
**Created:** [April 8, 2019, 12:59pm UTC](https://discuss.elastic.co/t/java-request-and-response-data-missing-when-annotations-or-using-apm-agent-api/175843 "2019-04-08T12:59:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![joel.ortin](https://avatars.discourse-cdn.com/v4/letter/j/5e9695/32.png) [@joel.ortin](https://discuss.elastic.co/u/joel.ortin)\
**Post date:** [April 8, 2019, 12:59pm UTC](https://discuss.elastic.co/t/java-request-and-response-data-missing-when-annotations-or-using-apm-agent-api/175843/1 "2019-04-08T12:59:36Z")

</div>

**Kibana version** : 6.7.0

**Elasticsearch version** : 6.7.0

**APM Server version** : 6.7.0

**APM Agent language and version** : Java, 1.5.0

**Browser version** : Mozilla firefox

**Original install method (e.g. download page, yum, deb, from source, etc.) and version**: Elastico deployment

**Fresh install or upgraded from other version?** : Fresh install

**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**: In a spring boot project (version 2.0.4.RELEASE), the request and response data from a transaction disappear when using annotations (@CaptureTransaction) or creating it manually :  
Transaction transaction = ElasticApm.startTransactionWithRemoteParent(key -\> request.getHeader(key));  
try (final Scope scope = transaction.activate()) {  
String name = "Controller#test";  
transaction.setName(name);  
transaction.setType(Transaction.TYPE\_REQUEST);  
....  
} catch (Exception e) {  
transaction.captureException(e);  
throw e;  
} finally {  
transaction.end();  
}

![imagen](https://us1.discourse-cdn.com/elastic/original/3X/9/b/9b16870a2bf46e0952dd5b2c2e23969b9f3b3f6f.png)

Transaction made by automatic instrumentation:

 ![imagen](https://us1.discourse-cdn.com/elastic/original/3X/4/f/4f93feab32a2e0e1e4c48bdad977008cf25490a9.png)  
**Steps to reproduce** :

How can I fill request/response data or make it appear.

Thanks

---

<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:** [April 8, 2019, 3:58pm UTC](https://discuss.elastic.co/t/java-request-and-response-data-missing-when-annotations-or-using-apm-agent-api/175843/2 "2019-04-08T15:58:04Z")

</div>

Hi and welcome to the forum 🎉

This is currently not possible with the API, unfortunately. There is [https://github.com/elastic/apm-agent-java/issues/433](https://github.com/elastic/apm-agent-java/issues/433) which you can upvote. Other than that, you can currently only use tags.

---

<div class="post-metadata">

**Author:** ![joel.ortin](https://avatars.discourse-cdn.com/v4/letter/j/5e9695/32.png) [@joel.ortin](https://discuss.elastic.co/u/joel.ortin)\
**Post date:** [April 9, 2019, 6:57am UTC](https://discuss.elastic.co/t/java-request-and-response-data-missing-when-annotations-or-using-apm-agent-api/175843/3 "2019-04-09T06:57:00Z")

</div>

Hi Felix,

Ok, thank you very much for your quick response.

---

<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:** [April 30, 2019, 2:59am UTC](https://discuss.elastic.co/t/java-request-and-response-data-missing-when-annotations-or-using-apm-agent-api/175843/4 "2019-04-30T02:59:43Z")

</div>

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