# Unknown route yet URL is populated

**URL:** <https://discuss.elastic.co/t/unknown-route-yet-url-is-populated/201303>\
**Category:** APM\
**Tags:** nodejs\
**Created:** [September 26, 2019, 7:16pm UTC](https://discuss.elastic.co/t/unknown-route-yet-url-is-populated/201303 "2019-09-26T19:16:41Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![karlpokus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karlpokus/32/48868_2.png) [@karlpokus](https://discuss.elastic.co/u/karlpokus)\
**Post date:** [September 26, 2019, 7:16pm UTC](https://discuss.elastic.co/t/unknown-route-yet-url-is-populated/201303/1 "2019-09-26T19:16:41Z")

</div>

If you are asking about a problem you are experiencing, please use the following template, as it will help us help you. If you have a different problem, please delete all of this text 🙂

**Kibana version** :  
7.3.2

**Elasticsearch version** :  
7.3.2

**APM Server version**  
7.3.2

**APM Agent language and version**  
elastic-apm-node v2.16.2

**Browser version**  
chrome Version 77.0.3865.90

**Original install method (e.g. download page, yum, deb, from source, etc.) and version**  
elastic apm components as docker images

**Fresh install or upgraded from other version?**  
fresh

**Is there anything special in your setup?** For example, are you using the Logstash or Kafka outputs? Are you using a load balancer in front of the APM Servers? Have you changed index pattern, generated custom templates, changed agent configuration etc.

Nothing special that I know of. apm server recieves request directly from agents.

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

Under APM / app / Transactions I have `GET unknown route` even though the URL field under transaction sample is populated with the correct url. I would expect the path from the url field to name the transaction. I have other transactions that are correct i.e GET some-path.

---

<div class="post-metadata">

**Author:** ![axw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/axw/32/28197_2.png) [@axw](https://discuss.elastic.co/u/axw)\
**Post date:** [September 27, 2019, 1:26am UTC](https://discuss.elastic.co/t/unknown-route-yet-url-is-populated/201303/2 "2019-09-27T01:26:53Z")

</div>

> Under APM / app / Transactions I have `GET unknown route` even though the URL field under transaction sample is populated with the correct url. I would expect the path from the url field to name the transaction. I have other transactions that are correct i.e GET some-path.

Generally the agents name transactions based on the registered route pattern — this depends on integration with various routers/frameworks, like Express, hapi, etc. We do this so you the transactions can be aggregated by name.

Which framework are you using?

---

<div class="post-metadata">

**Author:** ![stephenbelanger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenbelanger/32/34880_2.png) [@stephenbelanger](https://discuss.elastic.co/u/stephenbelanger)\
**Post date:** [September 27, 2019, 4:16am UTC](https://discuss.elastic.co/t/unknown-route-yet-url-is-populated/201303/3 "2019-09-27T04:16:58Z")

</div>

If you're not using a particular framework, you can try either the [`usePathAsTransactionName`](https://www.elastic.co/guide/en/apm/agent/nodejs/current/configuration.html#use-path-as-transaction-name) config option or calling [`apm.setTransactionName(name)`](https://www.elastic.co/guide/en/apm/agent/nodejs/current/agent-api.html#apm-set-transaction-name).

---

<div class="post-metadata">

**Author:** ![karlpokus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karlpokus/32/48868_2.png) [@karlpokus](https://discuss.elastic.co/u/karlpokus)\
**Post date:** [September 27, 2019, 6:58am UTC](https://discuss.elastic.co/t/unknown-route-yet-url-is-populated/201303/4 "2019-09-27T06:58:54Z")

</div>

@axw we use hapi v16.5.2 on the app side (where we see unknown routes). On the service side we use koa and everything's fine.

@stephenbelanger would that option work on top of hapi?

---

<div class="post-metadata">

**Author:** ![wa7son](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wa7son/32/21259_2.png) [@wa7son](https://discuss.elastic.co/u/wa7son)\
**Post date:** [October 1, 2019, 12:58pm UTC](https://discuss.elastic.co/t/unknown-route-yet-url-is-populated/201303/5 "2019-10-01T12:58:08Z")

</div>

That version of hapi is supported, so your hapi routes should be named accordingly. If those are the ones getting the `unknown route` name, let us know

For Koa, the story is a little different. Koa doesn't come with a built-in router, so it depends which router you're using. We've always supported `koa-router` and have since v2.17.0 also added support for `@koa/router`. If you're using the latter, you need to upgrade to that version to get correct names for your transactions in Koa.

---

<div class="post-metadata">

**Author:** ![karlpokus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karlpokus/32/48868_2.png) [@karlpokus](https://discuss.elastic.co/u/karlpokus)\
**Post date:** [October 2, 2019, 6:42am UTC](https://discuss.elastic.co/t/unknown-route-yet-url-is-populated/201303/6 "2019-10-02T06:42:32Z")

</div>

Actually it's the hapi routes that are unknown. Koa is fine.

---

<div class="post-metadata">

**Author:** ![wa7son](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wa7son/32/21259_2.png) [@wa7son](https://discuss.elastic.co/u/wa7son)\
**Post date:** [October 2, 2019, 9:02am UTC](https://discuss.elastic.co/t/unknown-route-yet-url-is-populated/201303/7 "2019-10-02T09:02:52Z")

</div>

Hmm interesting. If you change the Elastic APM log level to `trace` using the [`logLevel`](https://www.elastic.co/guide/en/apm/agent/nodejs/current/configuration.html#log-level) config option, you might be able to see why it's not picking up the expected route names.

If you don't mind sharing the logs here afterward, we might be able to see what's going on.

---

<div class="post-metadata">

**Author:** ![karlpokus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karlpokus/32/48868_2.png) [@karlpokus](https://discuss.elastic.co/u/karlpokus)\
**Post date:** [October 3, 2019, 7:03pm UTC](https://discuss.elastic.co/t/unknown-route-yet-url-is-populated/201303/8 "2019-10-03T19:03:18Z")

</div>

I don't have access to that particular env atm. Will post back here later.

---

<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:** [October 24, 2019, 3:03pm UTC](https://discuss.elastic.co/t/unknown-route-yet-url-is-populated/201303/9 "2019-10-24T15:03:23Z")

</div>

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