Access APM cloud remotely

I am new to Elastic. I would like to access my APM server on AWS, remotely, to fetch some transaction data and I'm wondering what the cURL command should be. From the documentation it say's to use curl -XGET "http://XXX.containerhost:9244/apm-6.6.1-transaction-2019.03.04/_search" However, I'm thinking this is an internal URL that we use once inside the Elastic container.

Basically, what I'm trying to do is, I've got a Drupal site running and I'm sending a transaction to the APM server every time a page request is made. I am able to successfully do this and can see the transaction when I log onto the APM cloud server. I would now like to write some tests in PHP that confirm that the transaction has been made by fetching the details from the cloud.

So, is there an URL that we could use remotely to fetch the transactions from the APM cloud?

APM Server version:
6.6.1

APM Agent language and version:
PHP Agent v1

All data written by APM lives is an elasticsearch index. So you can probably just query the index as a normal search. Is it what you want?

Yeah, I would like to query the Elastic search index and am wondering how to do that. Like what would be the command, URL, etc.

You are using elastic elasticsearch cloud service right?
The management console gives you what is the elasticsearch endpoint.

Just call it with /apm-*-transaction*/_search.

Yeah, I'm using the cloud service. I used dev-tools to get the endpoint and cURL command:

curl -XGET "http://XXX.containerhost:9244/apm-6.6.1-transaction-2019.03.04/_search"

However, when I use that in my command line, I get a curl: (6) Could not resolve host: error. I tried sending a GET request from PHP, but it's giving me the same error. Am I missing something?

Go to the cloud admin console (cloud.elastic.co), not dev tool, to get elasticsearch endpoint address.

1 Like

Ah! That's what I was doing wrong. So, we should be using the Elasticsearch endpoint URL provided in the cloud admin console. I was using the one provided by the Dev Tools all along.

That worked, thank you so much! Really appreciate your help.

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