Skip to content

Commit

Permalink
attempt to address #11574
Browse files Browse the repository at this point in the history
  • Loading branch information
colleenmcginnis committed Nov 29, 2023
1 parent f88c083 commit b2fce65
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions docs/source-map-how-to.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -95,19 +95,21 @@ module.exports = {

[float]
[[source-map-rum-upload]]
=== Upload the source map to {kib}
=== Upload the source map

TIP: Before uploading a source map, ensure that RUM support is enabled in the APM integration.

{kib} exposes a {kibana-ref}/rum-sourcemap-api.html[source map endpoint] for uploading source maps.
Source maps can be uploaded as a string, or as a file upload.
Before uploading a source map, ensure that RUM support is enabled in the APM integration

Let's look at two different ways to upload a source map: curl and a custom application.
Each example includes the four fields necessary for APM Server to later map minified code to its source:

* `service_name` - Should match the `serviceName` from step one
* `service_version` - Should match the `serviceVersion` from step one
* `bundle_filepath` - The absolute path of the final bundle as used in the web application
* `sourcemap` - The location of the source map.
* `service_name`: Should match the `serviceName` from step one.
* `service_version`: Should match the `serviceVersion` from step one.
* `bundle_filepath`: The absolute path of the final bundle as used in the web application.
* `sourcemap`: The location of the source map.

If you have multiple source maps, you'll need to upload each individually.

[float]
Expand Down Expand Up @@ -164,3 +166,15 @@ request.post({url: 'http://localhost:5601/api/apm/sourcemaps',formData: formData
}
})
----

// Not sure what to call this section...
[float]
[[source-map-next]]
=== What happens next

Source maps are stored in {es}. When you upload a source map, a new {es} index is created
containing the contents of the source map.

Then APM Server will periodically poll those documents to maintain a map of in-memory metadata.
When stack traces match the in-memory metadata, the corresponding source map is fetched,
parsed, and cached on demand.

0 comments on commit b2fce65

Please sign in to comment.