Sourcemap Upload APIedit

Source maps is an experimental feature not intended for production usage at the moment.

The APM Server exposes an API Endpoint to upload source maps, helpful if you are using real user monitoring.

Upload Endpointedit

To upload a source map you need to send a HTTP POST request with Content-Type set to multipart/form-data to the APM Server source maps endpoint:

http(s)://{hostname}:{port}/v1/client-side/sourcemaps

Request Fieldsedit

The request consists of some meta information and the actual source map. The meta information must contain the following fields:

  • service_name
  • service_version
  • bundle_filepath: needs to be the absolute path of the final bundle as it is used in the web application

The meta information is used to identify a source map when source mapping is applied.

The actual source map must be attached to the request as a file upload and it must match the specification for Source map revision 3 proposal.

Exampleedit

Send an example source map to the APM Server:

curl -X POST http://127.0.0.1:8200/v1/client-side/sourcemaps \
  -F service_name="test-service" \
  -F service_version="1.0" \
  -F bundle_filepath="http://localhost/static/js/bundle.js" \
  -F [email protected]