# RUM for hybrid mobile apps

**URL:** <https://discuss.elastic.co/t/rum-for-hybrid-mobile-apps/338010>\
**Category:** User Experience\
**Created:** [July 10, 2023, 9:53am UTC](https://discuss.elastic.co/t/rum-for-hybrid-mobile-apps/338010 "2023-07-10T09:53:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dduarte](https://avatars.discourse-cdn.com/v4/letter/d/b4bc9f/32.png) [@dduarte](https://discuss.elastic.co/u/dduarte)\
**Post date:** [July 10, 2023, 9:53am UTC](https://discuss.elastic.co/t/rum-for-hybrid-mobile-apps/338010/1 "2023-07-10T09:53:15Z")

</div>

Hi all,

We use OutSystems to develop mobile applications, which are ReactJS hybrid mobile applications underneath.

As we prepare to go-live, and even though some metrics can be retrieved using the RUM agent, other metric like performance, usability and device like application load time, transition between screens, battery status, etc..., aren't.

So, my question to the forum is: does anyone already implemented a similar scenario with elastic? and if so, what did you use to accomplish that?

Thank you in advance.

---

<div class="post-metadata">

**Author:** ![Alberto\_Delgado](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alberto_delgado/32/98488_2.png) [@Alberto\_Delgado](https://discuss.elastic.co/u/Alberto_Delgado)\
**Post date:** [July 11, 2023, 1:08pm UTC](https://discuss.elastic.co/t/rum-for-hybrid-mobile-apps/338010/2 "2023-07-11T13:08:44Z")

</div>

Hi @dduarte,

Thanks for reaching out and welcome to the community!

RUM agent has no specific integration for mobile devices.

Let me add a few comments/questions for each of the cases you are enumerating, please bear in mind, I'm not an expert on mobile applications, so maybe I'm assuming things that are completely inadequate

> metric like performance, device like application load time,

What do you mean exactly by this? Could you please elaborate more on this?

Out of the box, the agent gathers performance metrics ,you can see more info [here](https://www.elastic.co/guide/en/apm/agent/rum-js/current/supported-technologies.html#user-centric-metrics) and [here](https://www.elastic.co/guide/en/apm/agent/rum-js/current/supported-technologies.html#page-load-metrics)

> transition between screens

Do these transitions imply a change in the route? If so, we have a RUM [integration](https://www.elastic.co/guide/en/apm/agent/rum-js/current/supported-technologies.html#frameworks) for [React](https://www.elastic.co/guide/en/apm/agent/rum-js/current/react-integration.html) which automatically creates transactions when a route changes (only if the transition triggers a network request such as XHR, fetch)

The core rum agent would also do that, but the React integration enhances it.

If not so, you will need to create your own [custom transactions.](https://www.elastic.co/guide/en/apm/agent/rum-js/current/custom-transactions.html)

> usability

Could you give an example?

Generally, you can create custom transactions for everything that is not out of the box, an example would help to understand more.

> battery status

Same here, you could create a transaction with this info.

--

As you can see, every piece of information you want to send to APM needs to be associated with a transaction. I understand that for specific cases this is not the most desirable (like battery status), the agent still [doesn't support](https://github.com/elastic/apm-agent-rum-js/issues/197) user-custom metrics, which would enable you to send the metric "in a standalone way"

Cheers,  
Alberto

---

<div class="post-metadata">

**Author:** ![dduarte](https://avatars.discourse-cdn.com/v4/letter/d/b4bc9f/32.png) [@dduarte](https://discuss.elastic.co/u/dduarte)\
**Post date:** [July 13, 2023, 2:45pm UTC](https://discuss.elastic.co/t/rum-for-hybrid-mobile-apps/338010/3 "2023-07-13T14:45:43Z")

</div>

In fact there is already a mobile specific RUM agent but it is native. In my case the application is hybrid. In Dynatrace there is already a mobile agent for hybrid applications, but in Elastic this isn't available.

About the metrics mentioned, they do not involve transactions to the server but in the device. So, when I mention metrics like Application Load Time it's a standard that measures the time between the moment a user clicks the icon of the app and the app is displayed.

Cheers,  
Davide

---

<div class="post-metadata">

**Author:** ![Alberto\_Delgado](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alberto_delgado/32/98488_2.png) [@Alberto\_Delgado](https://discuss.elastic.co/u/Alberto_Delgado)\
**Post date:** [July 14, 2023, 3:14pm UTC](https://discuss.elastic.co/t/rum-for-hybrid-mobile-apps/338010/4 "2023-07-14T15:14:53Z")

</div>

Hi @dduarte,

Yes, you are right, we don't have any integration for hybrid applications.

And the transactions I mentioned to you before are created using the RUM browser [API](https://www.elastic.co/guide/en/apm/agent/rum-js/5.x/api.html), so you can send custom information to APM from the client side.

> metrics like Application Load Time it's a standard that measures the time between the moment a user clicks the icon of the app and the app is displayed.

If you can use javascript to intercept each step of that lifecycle then you could create the transaction using the APIs I mentioned before. But the agent will not create it automatically

[This blog post](https://www.elastic.co/blog/performing-real-user-monitoring-rum-with-elastic-apm) (Flexible custom instrumentation section) gives you another example of how to create custom transactions

If helps you to have more context:

In this [github issue](https://github.com/elastic/apm-agent-rum-js/issues/1276#issuecomment-1248259514), you will find an example of how to use custom transactions to instrument a React Native app. The battery status is not mentioned there nor is the application load time, but it's a good example of how you can create custom transactions. That example is also shared in [react expo](https://snack.expo.dev/eqbiMwaRU)

But again, as you already stated, there is no official support for hybrid applications.

Cheers,  
Alberto

---

<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 11, 2023, 3:15pm UTC](https://discuss.elastic.co/t/rum-for-hybrid-mobile-apps/338010/5 "2023-08-11T15:15:23Z")

</div>

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