No transactions for Apache HTTPClient

I'd like to get HTTPClient spans (transactions) into APM:

    -javaagent:c:/path-to-jar/elastic-apm-agent-1.12.0.jar ^
    -Delastic.apm.service_name=HTTP-Service ^
    -Delastic.apm.server_url=http://localhost:8200 ^
    -Delastic.apm.secret_token= ^
    -Delastic.apm.application_packages=org.apache,com.someother ^

According to the documentation:

the agent automatically creates spans for outgoing HTTP requests and propagates tracing headers.

But I'm getting JVM stats, and no transactions in Kibana.
Am I missing something?

Thanks!

OS: Windows 10

httpclient version: 4.5.3

Kibana version: 7.5.2

Elasticsearch version: 7.5.2

APM Server version: 7.5.2

APM Agent language and version: java 1.12.0

Hi and thanks for your question!

Which (web) framework are you using? Note that we only create spans if there's a transaction. So make sure you either use a supported web framework or to manually create a transaction.

See also the troubleshooting guide: https://www.elastic.co/guide/en/apm/agent/java/current/trouble-shooting.html

Thank you for getting back!
I use a custom java app, which includes HTTPclient libraries. I thought, the APM agent could magically capture the stats from the http client :slight_smile: , according to this:

For the supported HTTP libraries, the agent automatically creates spans for outgoing HTTP requests and propagates tracing headers. The spans are named after the schema <method> <host> , for example GET elastic.co .

Using that terminology Apache HttpClient is a framework, isn't it?

Is there a technical documentation about APM integration into external frameworks?
I'm trying to understand, how all these transaction and span stuff is working.
E.g. when some web-frameworks are supported: does that mean, that their owners have extended (added APM-related code) into the frameworks?
Thanks a lot!

Yes, it can do that but only if the http request happens within the context of a transaction.

See also Data Model | APM User Guide [8.11] | Elastic

See Frequently Asked Questions | APM Java Agent Reference [1.x] | Elastic

1 Like

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