Unknown route yet URL is populated

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 :slight_smile:

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.

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?

If you're not using a particular framework, you can try either the usePathAsTransactionName config option or calling apm.setTransactionName(name).

1 Like

@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?

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.

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

Hmm interesting. If you change the Elastic APM log level to trace using the logLevel 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.

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

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