# Transaction.SetUser not working properly when populating username

**URL:** <https://discuss.elastic.co/t/transaction-setuser-not-working-properly-when-populating-username/137092>\
**Category:** APM\
**Created:** [June 22, 2018, 10:35pm UTC](https://discuss.elastic.co/t/transaction-setuser-not-working-properly-when-populating-username/137092 "2018-06-22T22:35:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![csong](https://avatars.discourse-cdn.com/v4/letter/c/b2d939/32.png) [@csong](https://discuss.elastic.co/u/csong)\
**Post date:** [June 22, 2018, 10:35pm UTC](https://discuss.elastic.co/t/transaction-setuser-not-working-properly-when-populating-username/137092/1 "2018-06-22T22:35:54Z")

</div>

Hi,  
I am using Elastic APM Java agent api. When I am calling transaction.setUser(userId, userEmail, userName) in my method, userId and email are properly showing in kibana. However, username is always shown as N/A and I am pretty sure it is a valid username string when calling the setUser method.

Here's the code:

void function(userId, userName, email) {  
Transaction transaction = ElasticApm.currentTransaction();  
transaction.setUser(userId, email, userName);  
}

Any ideas why username is not populated ?

Thank you

---

<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:** [June 23, 2018, 6:02am UTC](https://discuss.elastic.co/t/transaction-setuser-not-working-properly-when-populating-username/137092/2 "2018-06-23T06:02:00Z")

</div>

Hi and thanks for reporting this!

This was indeed a bug sneaking in. I've fixed it in [https://github.com/elastic/apm-agent-java/pull/106](https://github.com/elastic/apm-agent-java/pull/106).

Keep the feedback coming 🙂

Thanks,  
Felix

---

<div class="post-metadata">

**Author:** ![csong](https://avatars.discourse-cdn.com/v4/letter/c/b2d939/32.png) [@csong](https://discuss.elastic.co/u/csong)\
**Post date:** [June 25, 2018, 1:41pm UTC](https://discuss.elastic.co/t/transaction-setuser-not-working-properly-when-populating-username/137092/3 "2018-06-25T13:41:18Z")

</div>

Hi Felix:  
Thanks for the fix ! When will the fix be released ? We are blocked by this issue.

---

<div class="post-metadata">

**Author:** ![csong](https://avatars.discourse-cdn.com/v4/letter/c/b2d939/32.png) [@csong](https://discuss.elastic.co/u/csong)\
**Post date:** [June 26, 2018, 8:47pm UTC](https://discuss.elastic.co/t/transaction-setuser-not-working-properly-when-populating-username/137092/4 "2018-06-26T20:47:45Z")

</div>

Hi Felix:  
Thanks for the fix ! When will the fix be released ? We are blocked by this issue.

---

<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:** [June 27, 2018, 5:08am UTC](https://discuss.elastic.co/t/transaction-setuser-not-working-properly-when-populating-username/137092/5 "2018-06-27T05:08:58Z")

</div>

It will be released soon.  
Can you build the agent from source in the meantime?

Clone the repo and execute  
./mvnw clean package -DskipTests=true

The agent jar is in the folder elastic-apm-agent/target

---

<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:** [July 18, 2018, 1:09am UTC](https://discuss.elastic.co/t/transaction-setuser-not-working-properly-when-populating-username/137092/6 "2018-07-18T01:09:12Z")

</div>

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