# Ember JS integration with APM agent

**URL:** <https://discuss.elastic.co/t/ember-js-integration-with-apm-agent/203796>\
**Category:** APM\
**Tags:** rum\
**Created:** [October 16, 2019, 9:18am UTC](https://discuss.elastic.co/t/ember-js-integration-with-apm-agent/203796 "2019-10-16T09:18:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Muralidhar\_K](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/muralidhar_k/32/45217_2.png) [@Muralidhar\_K](https://discuss.elastic.co/u/Muralidhar_K)\
**Post date:** [October 16, 2019, 9:18am UTC](https://discuss.elastic.co/t/ember-js-integration-with-apm-agent/203796/1 "2019-10-16T09:18:20Z")

</div>

Can you help providing snippet or code changes for setting up agent with Ember JS.

---

<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:** [October 21, 2019, 9:11am UTC](https://discuss.elastic.co/t/ember-js-integration-with-apm-agent/203796/2 "2019-10-21T09:11:32Z")

</div>

Hi Muralidhar,

We dont have EmberJS integration planned at the moment, But it would be quite similar to some of our framework specific integrations which you can find here [https://www.elastic.co/guide/en/apm/agent/rum-js/current/framework-integrations.html](https://www.elastic.co/guide/en/apm/agent/rum-js/current/framework-integrations.html)

To iterate the steps

1. Start the agent on app mount by calling `init` from the RUM API

```auto
import {init} from '@elastic/apm-rum'

const apm = init(config)

```

1. Listen to route events and start the transaction on navigation start and end the transaction when the navigation is completed.

```auto
import {inject as service} from '@ember/service';

export default Route.extend({
  router: service('router'),
  init() {
    this._super(...arguments);
    this.router.on('routeDidChange', (transition) => {
      const path = transition.to.name
       apm.startTransaction(path, 'route-change', {
          managed: true,
          canReuse: true
       })
    })
  }
});

```

I have never worked with Ember personally, the above code might not work properly. But you get the idea.

Thanks,  
Vignesh

---

<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:** [November 11, 2019, 5:18am UTC](https://discuss.elastic.co/t/ember-js-integration-with-apm-agent/203796/3 "2019-11-11T05:18:07Z")

</div>

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