# Cannot active RUM debug for Angular

**URL:** <https://discuss.elastic.co/t/cannot-active-rum-debug-for-angular/296614>\
**Category:** APM\
**Tags:** rum, language-clients\
**Created:** [February 8, 2022, 2:41pm UTC](https://discuss.elastic.co/t/cannot-active-rum-debug-for-angular/296614 "2022-02-08T14:41:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nicesp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nicesp/32/101537_2.png) [@nicesp](https://discuss.elastic.co/u/nicesp)\
**Post date:** [February 8, 2022, 2:41pm UTC](https://discuss.elastic.co/t/cannot-active-rum-debug-for-angular/296614/1 "2022-02-08T14:41:31Z")

</div>

Hello,

I'm doing a POC with ELK Cloud's APM and an Angular app that uses SpringBoot services.

For a call to an api that takes a minute, the RUM lib doesn't report anything at all. First concern.

To understand this I try to activate the debug in the JS console but without success.

This is a basic app for the POC, fresh installation with the latest version of the NPM package (2.1.4).

The config is at its simplest:

```
const apm = service.init({
  serviceName: 'angular-app',
  serverUrl: 'https://...........us-east4.gcp.elastic-cloud.com:443',
  distributedTracingOrigins: [environment.apiUrl],
  logLevel: 'debug'
});

```

The console remains empty...

Thank you !

---

<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:** [February 8, 2022, 4:33pm UTC](https://discuss.elastic.co/t/cannot-active-rum-debug-for-angular/296614/2 "2022-02-08T16:33:05Z")

</div>

Hi @nicesp,

Thanks for reaching out!

I have a couple of questions:

- What version of angular are you using?
- Are you seeing network requests coming from the agent in your browser network tab? (events/ endpoint)
- Is this behaviour reproducible in more than one browser?

For the description it seems that maybe the agent is disabled for some reason

What is the output of the following statements?:

`console.log(apm.isEnabled())`  
`console.log(apm.isActive())`

On the other hand, the following code checks if some feature is not available:

```auto
function isPlatformSupported() {
  if (typeof window === 'undefined') {
      console.log("window not defined")
      return
  }
    
  var xhr = new window.XMLHttpRequest()
  if (!('withCredentials' in xhr)) {
    console.log("CORS is not supported")
      return
  }

  if (typeof Set !== 'function') {
    console.log("Set is not a function")
      return
  }

  if (typeof JSON.stringify !== 'function') {
    console.log("JSON.stringify is not a function")
      return
  }

  if (typeof window.performance.now !== 'function') {
     console.log("window.performance is not a function")
      return
  }

  console.log("all checks passed properly")
}
isPlatformSupported()

```

Let me know if this helps you

Thanks,  
Alberto

---

<div class="post-metadata">

**Author:** ![nicesp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nicesp/32/101537_2.png) [@nicesp](https://discuss.elastic.co/u/nicesp)\
**Post date:** [February 9, 2022, 8:57am UTC](https://discuss.elastic.co/t/cannot-active-rum-debug-for-angular/296614/3 "2022-02-09T08:57:22Z")

</div>

Hi @Alberto_Delgado,

Thank you for the answer.

- I use Angular 13
- Yes, the agent work, events are sents, data and trace are displayed in ELK. Only about once in 10 or 20, when a particular call to my API takes (abnormally) one minute (with sucess), the events are not sent at all.
- I can reproduce on Brave (last version) or Chrome (last version)

I confirm that, in the event that the events are not sent, the checks have passed and the apm is active.

Thanks !

---

<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:** [February 9, 2022, 11:59am UTC](https://discuss.elastic.co/t/cannot-active-rum-debug-for-angular/296614/4 "2022-02-09T11:59:33Z")

</div>

Hi @nicesp,

The RUM agent ignores the debugLevel in prod environments:

```auto
process.env.NODE_ENV === 'production' // does not add debug logic

```

That's why your JS console is empty. In order to see the logs you may need to create a bundle with a non-production NODE\_ENV.

In the following link explains why: [Install the Agent | APM Real User Monitoring JavaScript Agent Reference [5.x] | Elastic](https://www.elastic.co/guide/en/apm/agent/rum-js/5.x/install-the-agent.html#production-build)

--  
On the other hand, [managed transactions](https://www.elastic.co/guide/en/apm/agent/rum-js/master/custom-transactions.html#custom-managed-transactions) such as http-requests have a threshold of 60 seconds, if the transaction duration is greater than that, it will be discarded by the agent.

Let me know if this helps you

Thanks,  
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:** [March 2, 2022, 8:00am UTC](https://discuss.elastic.co/t/cannot-active-rum-debug-for-angular/296614/5 "2022-03-02T08:00:25Z")

</div>

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