# Errors are not logged to APM

**URL:** <https://discuss.elastic.co/t/errors-are-not-logged-to-apm/237101>\
**Category:** APM\
**Tags:** rum, server\
**Created:** [June 15, 2020, 9:36am UTC](https://discuss.elastic.co/t/errors-are-not-logged-to-apm/237101 "2020-06-15T09:36:08Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![akosanovic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/akosanovic/32/58345_2.png) [@akosanovic](https://discuss.elastic.co/u/akosanovic)\
**Post date:** [June 15, 2020, 9:36am UTC](https://discuss.elastic.co/t/errors-are-not-logged-to-apm/237101/1 "2020-06-15T09:36:09Z")

</div>

**APM Agent language and version** : javascript; '@elastic/apm-rum: 4.9.1'

**Browser version** : Any

**Original install method (e.g. download page, yum, deb, from source, etc.) and version**: Elastic Cloud 7.1.1

**Is there anything special in your setup?**

- Angular v 5.2.0

**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**:

No error is logging to APM since 12AM UTC on Jun 11. No change was made on our side during this time. Throwing the error by force works for test Kibana (v7.6.2) but the same error is not logged to production (v 7.1.1)

**Production** Kibana:  
**Kibana version** : v 7.1.1  
**Elasticsearch version** : v 7.1.1  
**APM Server version** : v 7.1.1

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/3/b3b03ff39e79cf75bde3e7314e64990b0c077991.png)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/9/0/90b6147cd5c22381310b574aa9cb3f066d37bde6.png)

* * *

**TEST** Kibana  
**Kibana version** : v 7.6.2  
**Elasticsearch version** : v 7.6.2  
**APM Server version** : v 7.6.2

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/3/03b3e299c554e9290af08fe1a7e297f8839a8e8e.png)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/a/aa33efd67f21b2f6c15d31620c0428d9d463d299.png)

**Steps to reproduce** : Throw the generic error after app loads:

```auto
    setTimeout( () => {
      throw Error('Test Error');
    }, 1000 );

```

---

<div class="post-metadata">

**Author:** ![simitt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simitt/32/106406_2.png) [@simitt](https://discuss.elastic.co/u/simitt)\
**Post date:** [June 15, 2020, 11:03am UTC](https://discuss.elastic.co/t/errors-are-not-logged-to-apm/237101/2 "2020-06-15T11:03:31Z")

</div>

Hi @akosanovic,  
could you please check the health of the `error` index setup. You can do so by querying ` GET apm-7.1.1-error/_ilm/explain`. It should contain `managed: true` and no error information.

Please also check if any error events are ingested for your current version, by running ` GET apm-7.1.1-error/_count`

---

<div class="post-metadata">

**Author:** ![akosanovic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/akosanovic/32/58345_2.png) [@akosanovic](https://discuss.elastic.co/u/akosanovic)\
**Post date:** [June 15, 2020, 1:17pm UTC](https://discuss.elastic.co/t/errors-are-not-logged-to-apm/237101/3 "2020-06-15T13:17:12Z")

</div>

HI @simitt,  
Thanks for getting back,

I'm getting **error 404** for _apm-7.1.1_ and _apm-7.1.0_

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/2/42b1e18703627ee21bbdc645fa0edd3492101e6d.jpeg)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/4/649130b4e90346d9e212feacdc7627e9bfe78f65.jpeg)

* * *

but it works ok on the test env

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

How do we fix this?

---

<div class="post-metadata">

**Author:** ![simitt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simitt/32/106406_2.png) [@simitt](https://discuss.elastic.co/u/simitt)\
**Post date:** [June 15, 2020, 2:30pm UTC](https://discuss.elastic.co/t/errors-are-not-logged-to-apm/237101/4 "2020-06-15T14:30:03Z")

</div>

That is suprising. Have you changed any of the `apm-server.yml` configuration options and potentially disabled that the APM Server sets up templates and indices?  
If not, please restart the APM Server, which should automatically take care of setting up the according ILM aliases, policies, etc and then try to run the `_ilm/explain` query again.

---

<div class="post-metadata">

**Author:** ![akosanovic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/akosanovic/32/58345_2.png) [@akosanovic](https://discuss.elastic.co/u/akosanovic)\
**Post date:** [June 15, 2020, 2:56pm UTC](https://discuss.elastic.co/t/errors-are-not-logged-to-apm/237101/5 "2020-06-15T14:56:29Z")

</div>

We have tried restarting the APM Server but no changes.  
We have a managed elastic cluster and apm server. We don't manage these ourselves.  
We separate the apm indices in transactions, span and errors. And we create one index per day for each of these categories.  
Transactions indices are still getting created daily but the span indices stopped getting created on the 12th and the errors ones on the 13th.

---

<div class="post-metadata">

**Author:** ![simitt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simitt/32/106406_2.png) [@simitt](https://discuss.elastic.co/u/simitt)\
**Post date:** [June 16, 2020, 12:13pm UTC](https://discuss.elastic.co/t/errors-are-not-logged-to-apm/237101/6 "2020-06-16T12:13:11Z")

</div>

> [@akosanovic](#):
>
> We separate the apm indices in transactions, span and errors. And we create one index per day for each of these categories.

That sounds like you are not using [ILM](https://www.elastic.co/guide/en/apm/server/current/ilm-reference.html) which would be the default since `7.5`, but are manually setting the `output.elastic.indices`, in which case the above mentioned query will result in a `404`. It also looks like you have been using ILM in `7.6` though. Could you confirm whether or not you are overwriting the default index settings and want to make use of ILM?  
Can you check whether or not error events are generally ingested in 7.7 by running `GET apm-7.7.1-error*/_count`?

Since you are using an elastic managed cloud setup, you could also create a [Help Issue on cloud](https://cloud.elastic.co/help) for your deployment, mentioning APM ingestion issues, linking to this discuss post and mentioning me.

---

<div class="post-metadata">

**Author:** ![akosanovic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/akosanovic/32/58345_2.png) [@akosanovic](https://discuss.elastic.co/u/akosanovic)\
**Post date:** [June 22, 2020, 7:14am UTC](https://discuss.elastic.co/t/errors-are-not-logged-to-apm/237101/7 "2020-06-22T07:14:43Z")

</div>

Hi @simitt,

I think that my last response [Errors are not logged to APM](https://discuss.elastic.co/t/errors-are-not-logged-to-apm/237101/3) caused misunderstanding, can you just ignore the screenshot for 7.6.

We are using only APM version 7.1.(1) upgraded from 7.0.0. Does that mean we don't have ILM by default? How is this affecting our logging since 12 AM UTC on Jun 11?

---

<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:** [July 13, 2020, 3:22am UTC](https://discuss.elastic.co/t/errors-are-not-logged-to-apm/237101/8 "2020-07-13T03:22:19Z")

</div>

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