# RUM js agent - Failed transaction rate is "N/A" for different transaction types

**URL:** <https://discuss.elastic.co/t/rum-js-agent-failed-transaction-rate-is-n-a-for-different-transaction-types/329318>\
**Category:** APM\
**Tags:** rum\
**Created:** [April 4, 2023, 12:33pm UTC](https://discuss.elastic.co/t/rum-js-agent-failed-transaction-rate-is-n-a-for-different-transaction-types/329318 "2023-04-04T12:33:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dacothe](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@dacothe](https://discuss.elastic.co/u/dacothe)\
**Post date:** [April 4, 2023, 12:33pm UTC](https://discuss.elastic.co/t/rum-js-agent-failed-transaction-rate-is-n-a-for-different-transaction-types/329318/1 "2023-04-04T12:33:44Z")

</div>

**Kibana version** : 7.16.3

**Elasticsearch version** : 7.16.3

**APM Server version** : 7.16.3

**APM Agent language and version** : @elastic/apm-rum:5.12

**Browser version** : Chrome 110.0.5481.100

Hi all,  
We have recently started using the RUM js client to monitor the performance of our application.  
While analysing the data generated by the agent in Kibana, we noticed that the transactions of type: `page-load`, `user-interaction` and `route-change` always have the value "N/A". Further analysis has shown that for all spans ( `span.type!=http`) under these transactions, the field value `event.outcome` is set to `unknown` by the agent. This then also applies to the transaction above.

In the picture you can see such a transaction - here an http call (`Span.Type=http`) fails and the span gets the field value `event.outcome=failure`. However, the transaction has set the field value `event.outcome=unknown`.

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

This raises the following questions for us:

1. should the field `event.outcome=failure` be set on the transaction in such a case (see above)?
2. is the assumption correct that the RUM js agent does not set a value for the field `event.outcome` when dealing with RUM specific span - types? (e.g. `img`, `script`, `longtask`etc.) and therefore the `Failed transaction rate` is displayed as `N/A` in Kibana?

Thank you for a hint!

Many greetings,  
Thilo

---

<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:** [April 4, 2023, 11:54pm UTC](https://discuss.elastic.co/t/rum-js-agent-failed-transaction-rate-is-n-a-for-different-transaction-types/329318/2 "2023-04-04T23:54:28Z")

</div>

Hi @dacothe,

Thanks for raising and the detailed write up.

> we noticed that the transactions of type: `page-load` , `user-interaction` and `route-change` always have the value "N/A"

This is kind of a tricky question, I will try to answer my best here. For the events of the above type, there is no such thing as successful or failed outcome as the web page would be fire `load` event in all cases. We know that the request from the user perspective has succeeded which is why we have the outcome has not been set and it defaults to `unknown` for all of the transcations like `page-load`, `route-change`, etc.

But for the HTTP related transaction, its a clear backend request and we can define the outcome based on the request being successful or failure.

> 1. should the field `event.outcome=failure` be set on the transaction in such a case (see above)?

Setting `outcome=failure` for page-load transactions if any of the HTTP spans fails would look bad, reasons being

- There can be N number of API calls that belong to a single page-load event. We dont know which ones are relevant and which ones are not.
- Even third party API requests part of `page-load` also can impact the outcome of the transaction.

It would always be flaky, due to these reasons we have made the decision to not set the outcome for the user activity related transaction (ex: page-load, route-change) and do not want these events to be taken in to error rate calculation.

> is the assumption correct that the RUM js agent does not set a value for the field `event.outcome` when dealing with RUM specific span - types?

Yes, browsers right now do not expose the status code for these type of resources(img, script. etc). It might be possible to set the outcome once the `statusCode` is exposed - [Add response status codes for resources in Resource Timing API. · Issue #90 · w3c/resource-timing · GitHub](https://github.com/w3c/resource-timing/issues/90)

Thanks,  
Vignesh

---

<div class="post-metadata">

**Author:** ![dacothe](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@dacothe](https://discuss.elastic.co/u/dacothe)\
**Post date:** [April 17, 2023, 12:09pm UTC](https://discuss.elastic.co/t/rum-js-agent-failed-transaction-rate-is-n-a-for-different-transaction-types/329318/3 "2023-04-17T12:09:20Z")

</div>

Hello @vigneshshanmugam,

thank you very much for the very detailed explanation of the behaviour of the RumJS client - your explanations leave no question unanswered!

👌

Kind regards,  
Thilo

---

<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:** [May 8, 2023, 8:09am UTC](https://discuss.elastic.co/t/rum-js-agent-failed-transaction-rate-is-n-a-for-different-transaction-types/329318/4 "2023-05-08T08:09:34Z")

</div>

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