Ember JS integration with APM agent

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

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

To iterate the steps

  1. Start the agent on app mount by calling init from the RUM API
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.
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

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