Elastic-apm Java agent the unable to get msearch quries and aggregate & find mongo quries

Kibana version: 8.17

Elasticsearch version: 8.17.0

APM Server version: 1.55.0

APM Agent language and version: apm-javaagent , 1.55.0

Browser version:

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

Fresh install or upgraded from other version? Upgraded

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

I am not getting the elasticsearch msearch queries getting displayed in span details and also the aggregate and find mongo queries are not getting displayed .

I am using below environment variables . Could you please suggest is there anything else i am missing here to display the queries ?

ELASTIC_APM_ELASTICSEARCH_CAPTURE_BODY_URLS: *_count, *_sql, *_eql/search, *_async_search, *_search/template, *_msearch/template, *_search, *_msearch
ELASTIC_APM_LONG_FIELD_MAX_LENGTH: 200000
ELASTIC_APM_TRANSACTION_MAX_SPANS: 2000

Steps to reproduce:

  1. installed latest elastic-apm java agent 1.55.0
  2. Perform some msearch and mongodb activities

It’s not clear from your description what you are getting vs what you’re expecting. Are you getting these details for other types of ES and MONGODB queries, and this is specific to these subset? Or are you getting nothing related to ES and MONGODB?

Have you checked the supported tech to see if the versions you are using are supported? Have you turned on log_level to debug to check the transactions and spans are being emitted for the requests you are expecting them to be emitted for?

For MONGDB I note there is also a mongodb_capture_statement_commands option that might help

Hi @Jack_Shirazi ,

I am getting related to ES and MongoDB . But in some of subsets its not getting captured the msearch queries .

As per document Datastore configuration options | APM Java agent
i have updated the ELASTIC_APM_ELASTICSEARCH_CAPTURE_BODY_URLS: *_count, *_sql, *_eql/search, *_async_search, *_search/template, *_msearch/template, *_search, *_msearch

which has the msearch , however it’s not capturing the msearch queires .

But you ARE getting other queries? Are you sure you are making msearch queries?

Yeah i am making msearch only . i think sometimes i am not getting other queries too . Is there any default setting available which i am missing ?

There is no option that I can think of. If you are sometimes not getting details and sometimes you are, that’s very strange. Look for dropped spans in the logs (agent, apm server) and dropped span statistics. You can see exactly what the agent is sending by switching log_level to trace, but it’s very verbose