HeapHero API – Remote Location

In heap dump analysis API we have introduced a new feature called Remote Location. Using this feature now you can pass the http(s) URL location of your heap dump in the request.

Say suppose, you have stored your heap dump files in a remote location like AWS S3 bucket. In those cases, if you want to analyze your heap dumps then you will have to download files to your local machine and then invoke the API with heap dump file. To make it simple and automation easier we have introduced ‘location’ parameter in our API. You can pass http(s) URL location or AWS S3 presigned URL to the “location” parameter and invoke the API. When you do it the API will download file from the remote location, analyze the data and return back the response.

Here is a CURL command to invoke heap dump analysis API,

You can also invoke the API using other web service client tools such as: Postman, Soup UI, …

Here is an example of Postman tool,

Fig: Posting heap dump through Postman tool

Our API supports the following 13 file compress formats: zip, gz, xz, z, bz2, deflate, lz4, lzma, sz, zstd, tgz, tar, tar.gz. Compressing files is the process of making them smaller in terms of the number of bytes of data that they contain. We recommend you to compress and send heap dump files for fast and efficient processing. If you are passing a compressed heap dump file to the API then you need to pass “Content-Encoding” parameter in the request or add in request header.

Say suppose you are compressing heap dump file into ZIP format, then you can invoke the API with “Content-Encoding” request parameter:

Or you can pass “Content-Encoding” as HTTP header:

Note – Use the option “-data-binary” in the curl command instead of “-data” option. In “-data” option a new line break will be not preserved in the request. A new line break should be preserved for the legitimate parsing.

Here is an example of a Postman tool where passing “Content-Encoding” parameter in a API request.

Fig: How to pass “Content-Encoding” parameter in a API request?

Authenticating with remote servers

Some remote servers expect you to pass proper authentication credentials to download the resource. HeapHero provides you a simple mechanism to pass such authentication credentials.

Say you have stored your heap dump file in a JFrog artifactory server. Inorder to download any resources from the JFrog artifactory, it expects you to pass the X-JFrog-Art-Api header element with your assigned API Key. Say your API key is: ‘abc123’. 

In order to pass this API key to JFrog artifactory server, you can invoke the HeapHero API with location-X-JFrog-Art-Api=abc123 http parameter in the URL.

curl -X POST "https://api.heaphero.io/analyze-hd-api?apiKey={YOU_API_KEY}&location={HEAP-DUMP-HTTP-URL}&location-X-JFrog-Art-Api=abc123" --header "Content-Type:text"

Basically you need to prefix the authentication parameter name with the “location-“ prefix string and invoke the HeapHero API.

You can invoke also pass this element in HTTP header instead of HTTP URL i.e.

curl -X POST "https://api.heaphero.io/analyze-hd-api?apiKey={YOU_API_KEY}&location={HEAP-DUMP-HTTP-URL}" --header "Content-Type:text" --header "location-X-JFrog-Art-Api:abc123"

Note: Remote Location feature is only available in the HeapHero Enterprise edition

Leave a Reply

Powered by WordPress.com.

Up ↑

%d bloggers like this: