SourceMap のアップロード
この記事では、コントローラ UI と REST API を使用して SourceMap をアップロードする方法について説明します。
コントローラ UI でのソースマップのアップロード
- 左側のパネルで、[Configuration] をクリックします。
- ProGuard Mapping & NDK Symbol Files & Source Maps をクリックします。
- [Upload Missing ProGuard Mapping] ダイアログで、次の操作を実行します。
- パッケージのバージョン名を入力します。これは、このマッピングファイルが生成されたアプリケーションの
AndroidManifest.xmlファイルまたはbuild.gradleファイルのいずれかで指定されたversionNameプロパティです。 - [Choose File.] をクリックします。アップローダは
.txt拡張子を持つファイルを想定します。ファイルの名前はmapping.txtです。 - ファイルブラウザでマッピングファイルを見つけて選択し、Open をクリックします。
- Upload をクリックします。
- パッケージのバージョン名を入力します。これは、このマッピングファイルが生成されたアプリケーションの
Upload Source Maps with the REST API
The API uses HTTP basic authentication. The username is your Splunk AppDynamics EUM account name and the password is your EUM license key.
Send the Source Mapping file
- Americas
-
https://api.eum-appdynamics.com/v2/account/<MyAccountName>/<app-key>/<androidPackageName>/<version-string>/[Android/iOS]/jssource-mapping
- EMEA
-
https://fra-api.eum-appdynamics.com/v2/account/<MyAccountName>/<app-key>/<androidPackageName>/<version-string>/[Android/iOS]/jssource-mapping
- APAC
-
https://syd-api.eum-appdynamics.com/v2/account/<MyAccountName>/<app-key>/<androidPackageName>/<version-string>/[Android/iOS]/jssource-mapping
See SaaS Domain and IP Ranges for more EUM server locations.
These parameters are required:
MyAccountName: the URL-encoded version of your account name.androidPackagename: the name of the Android package for which this mapping file was generated.versionName: the string representation of the "version-string" property specified in either theAndroidManifest.xmlfile or thebuild.gradlefile of the application for which this mapping file was generated.
The request body contains the mapping file. You are required to add a Content-Type -H Content-Type:text/plain,
Sample Request and Response Using the REST APIThis is a sample request and response using the REST API.
Upload RequestThe following example uses curl to send a Source Map file. You would use a similar command to send a DexGuard mapping file. The account name is "Example account" and the license key/password is "Example-License-Key-4e8ec2ae6cfe". The plus signs replace spaces in the account name when the account name is URL-encoded. The package name of the Android application is "com.appdynamics.android.ReactNativeEveryFeature". The mapping file corresponds to the version with versionName
Syntax
curl -v -H Content-Type:text/plain --upload-file main.jsbundle.map --user <EUMAccountName>:<license-key> https://api.eum-appdynamics.com/v2/account/<EUMAccountName>/<App-key>/<App-Name>/<version>/<Android/IOS>/jssource-mapping
Examples:
- Android
-
curl -v -H Content-Type:text/plain --upload-file "index.android.bundle.txt" --user Example+account:Example-License-Key-4e8ec2ae6cfe https://shadow-eum-api.appdynamics.com/v2/Example+account/SH-AAB-AAE-WNX/com.appdynamics.android.ReactNativeEveryFeature/1/Android/jssource-mapping
- iOS
-
curl -v -H Content-Type:text/plain --upload-file main.jsbundle.map" --user Example+account:Example-License-Key-4e8ec2ae6cfe https://shadow-eum-api.eum-appdynamics.com/v2/account/Example+account/SH-AAB-AAE-WNX/com.appdynamics.ios.ReactNativeEveryFeature/1.0/iOS/jssource-mapping
The API uses HTTP basic authentication. The username is your Splunk AppDynamics EUM account name and the password is your EUM license key.
Upload RequestThe following example uses curl to send a Source Mapping file. You would use a similar command to send a DexGuard mapping file. The account name is "Example account" and the license key/password is "Example-License-Key-4e8ec2ae6cfe". The plus signs replace spaces in the account name when the account name is URL-encoded. The package name of the Android application is "com.example.networklogger". The mapping file corresponds to the version with versionName.
Upload Response- Americas
-
* About to connect() to api.eum-appdynamics.com port 443 (#0) * Trying ::1... * connected * Connected to api.eum-appdynamics.com (::1) port 443 (#0) * Server auth using Basic with user 'Example+account' > PUT /v2/account/Example+account/com.example.networklogger/1/jssource-mapping HTTP/1.1 > Authorization: Basic SW50ZXJuYWwrdGVzdCthY2NvdW50OlRlc3RBY2N0LTFlMzktNDVkMy05MzAzLTRlOGVjMmFlNmNmZQ== > User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8y zlib/1.2.5 > Host: api.eum-appdynamics.com > Accept: */* > Content-Length: 4 > Expect: 100-continue > < HTTP/1.1 100 Continue * We are completely uploaded and fine < HTTP/1.1 200 OK < Content-Length: 0 < Server: Jetty(8.1.4.v20120524) < * Connection #0 to host api.eum-appdynamics.com left intact * Closing connection #0
- EMEA
-
* About to connect() to fra-api.eum-appdynamics.com port 443 (#0) * Trying ::1... * connected * Connected to fra-api.eum-appdynamics.com (::1) port 443 (#0) * Server auth using Basic with user 'Example+account' > PUT /v2/account/Example+account/com.example.networklogger/1/jssource-mapping HTTP/1.1 > Authorization: Basic SW50ZXJuYWwrdGVzdCthY2NvdW50OlRlc3RBY2N0LTFlMzktNDVkMy05MzAzLTRlOGVjMmFlNmNmZQ== > User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8y zlib/1.2.5 > Host: fra-api.eum-appdynamics.com > Accept: */* > Content-Length: 4 > Expect: 100-continue > < HTTP/1.1 100 Continue * We are completely uploaded and fine < HTTP/1.1 200 OK < Content-Length: 0 < Server: Jetty(8.1.4.v20120524) < * Connection #0 to host fra-api.eum-appdynamics.com left intact * Closing connection #0
- APAC
-
* About to connect() to syd-api.eum-appdynamics.com port 443 (#0) * Trying ::1... * connected * Connected to syd.eum-appdynamics.com (::1) port 443 (#0) * Server auth using Basic with user 'Example+account' > PUT /v2/account/Example+account/com.example.networklogger/1/jssource-mapping HTTP/1.1 > Authorization: Basic SW50ZXJuYWwrdGVzdCthY2NvdW50OlRlc3RBY2N0LTFlMzktNDVkMy05MzAzLTRlOGVjMmFlNmNmZQ== > User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8y zlib/1.2.5 > Host: syd-api.eum-appdynamics.com > Accept: */* > Content-Length: 4 > Expect: 100-continue > < HTTP/1.1 100 Continue * We are completely uploaded and fine < HTTP/1.1 200 OK < Content-Length: 0 < Server: Jetty(8.1.4.v20120524) < * Connection #0 to host syd-api.eum-appdynamics.com left intact * Closing connection #0
トークンを使用した REST API でのソースマップのアップロード
MAPPING_FILE_UPLOAD_API_DISABLED: Trueソースマップファイルをアップロードするには、次の手順を実行します。