# Expose error.type and error.message

**URL:** <https://discuss.elastic.co/t/expose-error-type-and-error-message/189565>\
**Category:** APM\
**Tags:** java\
**Created:** [July 9, 2019, 2:06pm UTC](https://discuss.elastic.co/t/expose-error-type-and-error-message/189565 "2019-07-09T14:06:31Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![suikast42](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/suikast42/32/29865_2.png) [@suikast42](https://discuss.elastic.co/u/suikast42)\
**Post date:** [July 9, 2019, 2:06pm UTC](https://discuss.elastic.co/t/expose-error-type-and-error-message/189565/1 "2019-07-09T14:06:31Z")

</div>

The apm captureException writes the hole stack to error.exception in json format.

But error.message ( from ecs ) is not filled.

It can be very helpful to have exception.type and exception.message for dashboarding issues.

![image](https://us1.discourse-cdn.com/elastic/original/3X/8/2/82e6d3c2f3fc164db9cfd7eb7c9fcc3db121b1f8.png)

---

<div class="post-metadata">

**Author:** ![wa7son](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wa7son/32/21259_2.png) [@wa7son](https://discuss.elastic.co/u/wa7son)\
**Post date:** [July 9, 2019, 2:20pm UTC](https://discuss.elastic.co/t/expose-error-type-and-error-message/189565/2 "2019-07-09T14:20:16Z")

</div>

Which APM agent are you using (Java, Python, Node.js, Go, Ruby, .NET, RUM)?

---

<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:** [July 9, 2019, 2:37pm UTC](https://discuss.elastic.co/t/expose-error-type-and-error-message/189565/3 "2019-07-09T14:37:42Z")

</div>

@suikast42 so, you get `error.exception.message` and `error.exception.type` but you would like to get the message also as `error.message` to conform to ECS?

---

<div class="post-metadata">

**Author:** ![suikast42](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/suikast42/32/29865_2.png) [@suikast42](https://discuss.elastic.co/u/suikast42)\
**Post date:** [July 9, 2019, 3:47pm UTC](https://discuss.elastic.co/t/expose-error-type-and-error-message/189565/4 "2019-07-09T15:47:43Z")

</div>

> [@wa7son](#):
>
> Which APM agent are you using (Java, Python, Node.js, Go, Ruby, .NET, RUM)?

java apm agent v 1.7.0

---

<div class="post-metadata">

**Author:** ![suikast42](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/suikast42/32/29865_2.png) [@suikast42](https://discuss.elastic.co/u/suikast42)\
**Post date:** [July 9, 2019, 3:48pm UTC](https://discuss.elastic.co/t/expose-error-type-and-error-message/189565/5 "2019-07-09T15:48:47Z")

</div>

> [@Eyal\_Koren](#):
>
> so, you get `error.exception.message` and `error.exception.type`

No I didn't . That's the exposed fileds by java agent

![image](https://us1.discourse-cdn.com/elastic/original/3X/c/2/c223010adb53ab4df84b20b0eda6ccaf6dbccb6e.png)

And the error.excpetion filed holds all the stack in json format.

---

<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:** [July 10, 2019, 8:15am UTC](https://discuss.elastic.co/t/expose-error-type-and-error-message/189565/6 "2019-07-10T08:15:32Z")

</div>

I think it only looks this way in Discover, but these fields exist.  
Try to do a query on them, or check you index mappings.

---

<div class="post-metadata">

**Author:** ![suikast42](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/suikast42/32/29865_2.png) [@suikast42](https://discuss.elastic.co/u/suikast42)\
**Post date:** [July 10, 2019, 8:42am UTC](https://discuss.elastic.co/t/expose-error-type-and-error-message/189565/7 "2019-07-10T08:42:44Z")

</div>

The mapping is ok. That fields have a mapping.  
I can query them too.  
the query error.message : \* delivers empty result

---

<div class="post-metadata">

**Author:** ![simitt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simitt/32/106406_2.png) [@simitt](https://discuss.elastic.co/u/simitt)\
**Post date:** [July 10, 2019, 9:56am UTC](https://discuss.elastic.co/t/expose-error-type-and-error-message/189565/8 "2019-07-10T09:56:47Z")

</div>

Hi, it is expected behavior that `error.message` is not populated for APM data. Since an error can have an `exception.message` and a `log.message` those messages are stored in a nested way and we do not decide which of those messages would be _most important_ to propagate them to top level.

---

<div class="post-metadata">

**Author:** ![suikast42](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/suikast42/32/29865_2.png) [@suikast42](https://discuss.elastic.co/u/suikast42)\
**Post date:** [July 10, 2019, 3:39pm UTC](https://discuss.elastic.co/t/expose-error-type-and-error-message/189565/9 "2019-07-10T15:39:44Z")

</div>

> [@simitt](#):
>
> `error.message` is not populated for APM data. Since an error can have an `exception.message` and a `log.message`

I am not agree with that statement. I is a very helpful feature to now if a boundary invocation ( which captured by an apm transaction ) was exceptional or not.  
Regardless from the exception logging.

---

<div class="post-metadata">

**Author:** ![simitt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simitt/32/106406_2.png) [@simitt](https://discuss.elastic.co/u/simitt)\
**Post date:** [July 10, 2019, 6:14pm UTC](https://discuss.elastic.co/t/expose-error-type-and-error-message/189565/10 "2019-07-10T18:14:03Z")

</div>

You are welcome to open a feature request issue in the [apm-server repo](https://github.com/elastic/apm-server). If you do so, please add information about your use case and which logic you would expect to fill the `error.message` field with, considering all the available information of an error.

---

<div class="post-metadata">

**Author:** ![suikast42](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/suikast42/32/29865_2.png) [@suikast42](https://discuss.elastic.co/u/suikast42)\
**Post date:** [July 11, 2019, 5:10am UTC](https://discuss.elastic.co/t/expose-error-type-and-error-message/189565/11 "2019-07-11T05:10:29Z")

</div>

> [@simitt](#):
>
> You are welcome to open a feature request issue in the [apm-server repo](https://github.com/elastic/apm-server).

Doesn't that stuff belongs to apm-java-agent ??

---

<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:** [August 1, 2019, 1:16am UTC](https://discuss.elastic.co/t/expose-error-type-and-error-message/189565/12 "2019-08-01T01:16:58Z")

</div>

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