# Errors not getting labels from spans

**URL:** <https://discuss.elastic.co/t/errors-not-getting-labels-from-spans/207334>\
**Category:** APM\
**Tags:** rum\
**Created:** [November 11, 2019, 10:59am UTC](https://discuss.elastic.co/t/errors-not-getting-labels-from-spans/207334 "2019-11-11T10:59:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexr](https://avatars.discourse-cdn.com/v4/letter/a/8dc957/32.png) [@alexr](https://discuss.elastic.co/u/alexr)\
**Post date:** [November 11, 2019, 10:59am UTC](https://discuss.elastic.co/t/errors-not-getting-labels-from-spans/207334/1 "2019-11-11T10:59:26Z")

</div>

**Kibana version** : 7.2.0

**Elasticsearch version** : 7.2.0

**APM Server version** : 7.2.0

**APM Agent language and version** : JavaScript agent version 4.5.1

**Browser version** : Safari 13.0.3

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

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

**Is there anything special in your setup?** We're using the hosted version of Elastic, but other than that, nothing special.

**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**:

**Steps to reproduce** :

1. Initialise the APM agent
2. Start a span using the agent's `startSpan()` method
3. Add a label to the span: `span.addLabels({'my_label': 'my value'})`
4. Cause an error to be raised during the span so it is captured by the error handler installed by the APM agent

**Expected behaviour:** Since the error occurs during a span, it should be associated with that span and inherit the label `my_label` from that span.

**Actual behaviour:** The error is not associated with that span when viewed in Kibana, and does not have any labels.

---

<div class="post-metadata">

**Author:** ![vigneshshanmugam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vigneshshanmugam/32/40324_2.png) [@vigneshshanmugam](https://discuss.elastic.co/u/vigneshshanmugam)\
**Post date:** [November 11, 2019, 11:31am UTC](https://discuss.elastic.co/t/errors-not-getting-labels-from-spans/207334/2 "2019-11-11T11:31:59Z")

</div>

Hi Alex,

Right now the RUM agent does not support copying over span information to the errors at the moment. I have created an issue [https://github.com/elastic/apm-agent-rum-js/issues/476](https://github.com/elastic/apm-agent-rum-js/issues/476) as an enhancement request and will update the issue with more details.

Thanks,  
Vignesh

---

<div class="post-metadata">

**Author:** ![alexr](https://avatars.discourse-cdn.com/v4/letter/a/8dc957/32.png) [@alexr](https://discuss.elastic.co/u/alexr)\
**Post date:** [November 11, 2019, 11:34am UTC](https://discuss.elastic.co/t/errors-not-getting-labels-from-spans/207334/3 "2019-11-11T11:34:22Z")

</div>

Thanks for doing that for me!

---

<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 2, 2019, 7:34am UTC](https://discuss.elastic.co/t/errors-not-getting-labels-from-spans/207334/4 "2019-12-02T07:34:25Z")

</div>

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