ソースマップのアップロード
https://sourcemap-intake.datadoghq.com/api/v2/srcmaphttps://sourcemap-intake.us3.datadoghq.com/api/v2/srcmaphttps://sourcemap-intake.us5.datadoghq.com/api/v2/srcmaphttps://sourcemap-intake.datadoghq.eu/api/v2/srcmaphttps://sourcemap-intake.ap1.datadoghq.com/api/v2/srcmaphttps://sourcemap-intake.ap2.datadoghq.com/api/v2/srcmapNot supported in the UK1 regionhttps://sourcemap-intake.ddog-gov.com/api/v2/srcmapNot supported in the US2-FED region概要
エラーの難読化を解除するために、ソースマップ、シンボルファイル、およびマッピングファイルを Datadog にアップロードします。 このエンドポイントを使用すると、RUM Error Tracking 用のさまざまな種類のデバッグシンボルをアップロードできます。 これにより、Datadog は縮小または難読化されたコードの代わりに、読み取り可能なスタックトレースを表示できるようになります。
リクエスト形式:
各リクエストは、以下の 2 つのパートを含む「multipart/form-data」アップロードです。
1.「event」— アップロードメタデータ (タイプ、サービス、バージョンなど) を含む JSON エンコードされたイベント文字列 2. 1 つ以上のバイナリファイルフィールド (例:「source_map」、「symbols_archive」)
サポートされているアップロードタイプ (「event.type」で設定): -「js_sourcemap」: ブラウザアプリケーション用 JavaScript ソースマップ -「react_native_sourcemap」: モバイルアプリケーション用 React Native ソースマップ -「jvm_mapping_file」: Android クラッシュの難読化解除用 ProGuard/R8 マッピングファイル -「ios_symbols」: iOS クラッシュのシンボリケーション用 dSYM ファイル -「flutter_symbol_file」: Flutter シンボルファイル -「ndk_symbol_file」: ネイティブクラッシュ用 Android NDK シンボルファイル -「il2cpp_mapping_file」: Unity 用 IL2CPP マッピングファイル -「elf_symbol_file」: Linux/Unix 用 ELF シンボルファイル -「pe_symbol_file」: Windows 用 PE/PDB シンボルファイル -「repository」: ソースコードリンク用のリポジトリメタデータ
制限:
- 最大ファイルサイズ: 500 MB
注: ほとんどのユースケースでは、Datadog では以下の使用を推奨しています。 Datadog CLI (datadog-ci) ソースマップをアップロードするための簡略化されたインターフェースを提供します。
リクエスト
Body Data (required)
Option 1ソースマップ、シンボルファイル、またはマッピングファイルをアップロードするためのマルチパートフォームデータ。
event [required]Metadata for a JavaScript source map upload, sent as a JSON-encoded event field.
cli_versionVersion of the CLI used for upload (max 50 characters).
git_commit_shaGit commit SHA (40 lowercase hex characters).
git_repository_urlGit repository URL (max 2048 characters).
minified_url [required]URL of the minified JavaScript file (1-2048 characters).
overwriteWhether to overwrite existing source map.
falseproject_pathPath to the project root (max 500 characters).
service [required]Service name (1-200 characters).
type [required]Must be js_sourcemap.
js_sourcemapversion [required]Version of the service (1-200 characters).
minified_file [required]The minified JavaScript file.
repositoryRepository metadata file (optional).
source_map [required]The source map file.
Option 2Multipart form data for uploading React Native source maps for mobile applications.
event [required]Metadata for a React Native source map upload, sent as a JSON-encoded event field.
build_numberBuild number (max 200 characters).
bundle_name [required]Name of the JavaScript bundle (1-200 characters).
bundle_versionBundle version (max 200 characters).
cli_versionVersion of the CLI used for upload (max 50 characters).
debug_idDebug identifier for the source map file.
platform [required]Target platform for mobile source maps.
android, iosproject_pathPath to the project root (max 500 characters).
service [required]Service name (1-200 characters).
type [required]Must be react_native_sourcemap.
react_native_sourcemapversion [required]Version of the service (1-200 characters).
minified_fileThe minified JavaScript bundle (optional).
repositoryRepository metadata file (optional).
source_map [required]The source map file.
Option 3Multipart form data for uploading ProGuard or R8 mapping files for Android crash deobfuscation.
event [required]Metadata for a ProGuard or R8 mapping file upload, sent as a JSON-encoded event field.
build_idBuild identifier for the mapping file.
overwriteWhether to overwrite existing mapping file.
falseservice [required]Service name (1-200 characters).
type [required]Must be jvm_mapping_file.
jvm_mapping_filevariantBuild variant (max 200 characters).
version [required]Version of the service (1-200 characters).
jvm_mapping_file [required]The ProGuard/R8 mapping file.
repositoryRepository metadata file (optional).
Option 4Multipart form data for uploading dSYM files for iOS crash symbolication.
event [required]Metadata for an iOS dSYM file upload, sent as a JSON-encoded event field.
type [required]Must be ios_symbols.
ios_symbolsuuids [required]Comma-separated list of dSYM UUIDs (min 1 character).
symbols_archive [required]The dSYM archive file (.zip).
Option 5Multipart form data for uploading Flutter symbol files for crash symbolication.
event [required]Metadata for a Flutter symbol file upload, sent as a JSON-encoded event field.
arch [required]CPU architecture (1-200 characters).
cli_versionVersion of the CLI used for upload (max 50 characters).
platform [required]Target platform (1-200 characters).
service [required]Service name (1-200 characters).
type [required]Must be flutter_symbol_file.
flutter_symbol_filevariant [required]Build variant (1-200 characters).
version [required]Version of the service (1-200 characters).
flutter_symbol_file [required]The Flutter symbol file.
Option 6Multipart form data for uploading Android NDK symbol files for native crash symbolication.
event [required]Metadata for an Android NDK symbol file upload, sent as a JSON-encoded event field.
arch [required]CPU architecture (1-200 characters).
build_id [required]Build ID (1-200 characters).
filenameOriginal filename (max 500 characters).
type [required]Must be ndk_symbol_file.
ndk_symbol_filendk_symbol_file [required]The NDK symbol file.
Option 7Multipart form data for uploading IL2CPP mapping files for Unity crash symbolication.
event [required]Metadata for a Unity IL2CPP mapping file upload, sent as a JSON-encoded event field.
build_id [required]Build ID (1-200 characters).
type [required]Must be il2cpp_mapping_file.
il2cpp_mapping_fileil2cpp_mapping_file [required]The IL2CPP mapping file.
Option 8Multipart form data for uploading ELF symbol files for Linux/Unix crash symbolication.
elf_symbol_file [required]The ELF symbol file.
event [required]Metadata for an ELF symbol file upload, sent as a JSON-encoded event field.
archCPU architecture (max 200 characters).
cli_versionVersion of the CLI used for upload (max 50 characters).
file_hashFile hash (32 hex characters, or empty).
filenameOriginal filename (max 500 characters).
gnu_build_idGNU Build ID (16+ hex characters, or empty).
go_build_idGo Build ID (or redacted, or empty).
originOrigin identifier (max 200 characters).
origin_versionOrigin version (max 200 characters).
overwriteWhether to overwrite existing symbol file.
falsesymbol_sourceSymbol source (max 200 characters).
type [required]Must be elf_symbol_file.
elf_symbol_fileOption 9Multipart form data for uploading PE/PDB symbol files for Windows crash symbolication.
event [required]Metadata for a PE/PDB symbol file upload, sent as a JSON-encoded event field.
arch [required]CPU architecture (1-200 characters).
cli_versionVersion of the CLI used for upload (max 50 characters).
filenameOriginal filename (max 500 characters).
originOrigin identifier (max 200 characters).
origin_versionOrigin version (max 200 characters).
overwriteWhether to overwrite existing symbol file.
falsepdb_age [required]PDB age (>= 0).
pdb_sig [required]PDB signature GUID.
type [required]Must be pe_symbol_file.
pe_symbol_filepe_symbol_file [required]The PDB symbol file.
Option 10Multipart form data for uploading repository metadata for source code linking.
event [required]Metadata for a repository upload, sent as a JSON-encoded event field.
cli_versionVersion of the CLI used for upload (max 50 characters).
git_commit_sha [required]Git commit SHA (40 lowercase hex characters).
git_repository_url [required]Git repository URL (max 2048 characters).
type [required]Must be repository.
repositoryrepository [required]Repository metadata file.
JavaScript Source Map Upload
-F 'event={"git_commit_sha":"a1b2c3d4e5f6789012345678901234567890abcd","git_repository_url":"https://github.com/myorg/my-web-app","minified_url":"https://example.com/static/js/main.min.js","service":"my-web-app","type":"js_sourcemap","version":"1.2.3"};type=application/json'
-F 'minified_file=@main.min.js'
-F 'source_map=@main.min.js.map'ELF Symbol File Upload
-F 'elf_symbol_file=@libmyapp.so'
-F 'event={"arch":"x86_64","gnu_build_id":"abcdef1234567890abcdef1234567890","type":"elf_symbol_file"};type=application/json'Flutter Symbol File Upload
-F 'event={"arch":"arm64","platform":"android","service":"my-flutter-app","type":"flutter_symbol_file","variant":"release","version":"1.0.0"};type=application/json'
-F 'flutter_symbol_file=@app.symbols'Unity IL2CPP Mapping File Upload
-F 'event={"build_id":"unity-build-12345","type":"il2cpp_mapping_file"};type=application/json'
-F 'il2cpp_mapping_file=@il2cpp_data.dat'iOS dSYM Upload
-F 'event={"type":"ios_symbols","uuids":"A1B2C3D4-E5F6-7890-ABCD-EF1234567890"};type=application/json'
-F 'symbols_archive=@MyApp.dSYM.zip'ProGuard/R8 Mapping File Upload
-F 'event={"service":"my-android-app","type":"jvm_mapping_file","variant":"release","version":"3.1.0"};type=application/json'
-F 'jvm_mapping_file=@mapping.txt'Android NDK Symbol File Upload
-F 'event={"arch":"arm64-v8a","build_id":"abc123def456","type":"ndk_symbol_file"};type=application/json'
-F 'ndk_symbol_file=@libnative.so'Windows PE/PDB Symbol File Upload
-F 'event={"arch":"x64","pdb_age":1,"pdb_sig":"A1B2C3D4-E5F6-7890-ABCD-EF1234567890","type":"pe_symbol_file"};type=application/json'
-F 'pe_symbol_file=@myapp.pdb'React Native Source Map Upload
-F 'event={"build_number":"100","bundle_name":"main.jsbundle","platform":"ios","service":"my-mobile-app","type":"react_native_sourcemap","version":"2.0.0"};type=application/json'
-F 'source_map=@main.jsbundle.map'Repository Metadata Upload
-F 'event={"git_commit_sha":"a1b2c3d4e5f6789012345678901234567890abcd","git_repository_url":"https://github.com/myorg/my-web-app","type":"repository"};type=application/json'
-F 'repository=@repository.json'応答
OK
Response for source map upload.
dataData envelope for source map upload response.
idUnique identifier for the uploaded source map.
typeType of the response.
sourcemap_upload{
"data": {
"id": "sourcemap-upload-id",
"type": "sourcemap_upload"
}
}Accepted - the request has been accepted for processing.
Response for source map upload.
dataData envelope for source map upload response.
idUnique identifier for the uploaded source map.
typeType of the response.
sourcemap_upload{
"data": {
"id": "sourcemap-upload-id",
"type": "sourcemap_upload"
}
}Bad Request - Invalid request body or missing required fields.
Error response for source map upload.
errorsA list of errors.
{
"errors": [
"Missing required field: service"
]
}Unauthorized - Invalid or missing API key.
Error response for source map upload.
errorsA list of errors.
{
"errors": [
"Missing required field: service"
]
}Forbidden - Insufficient permissions.
Error response for source map upload.
errorsA list of errors.
{
"errors": [
"Missing required field: service"
]
}Not Found - The requested resource was not found.
Error response for source map upload.
errorsA list of errors.
{
"errors": [
"Missing required field: service"
]
}Request Timeout - The request took too long to complete.
Error response for source map upload.
errorsA list of errors.
{
"errors": [
"Missing required field: service"
]
}Payload Too Large - File size exceeds the 500 MB limit.
Error response for source map upload.
errorsA list of errors.
{
"errors": [
"Missing required field: service"
]
}Too Many Requests - Rate limit exceeded.
Error response for source map upload.
errorsA list of errors.
{
"errors": [
"Missing required field: service"
]
}Service Unavailable - The service is temporarily unavailable.
Error response for source map upload.
errorsA list of errors.
{
"errors": [
"Missing required field: service"
]
}コード例
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
export DD_API_KEY="<DD_API_KEY>"
curl -X POST "https://sourcemap-intake.${DD_SITE}/api/v2/srcmap" \
-H "Accept: application/json" \
-H "Content-Type: multipart/form-data" \
-H "DD-API-KEY: ${DD_API_KEY}"# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
export DD_API_KEY="<DD_API_KEY>"
curl -X POST "https://sourcemap-intake.${DD_SITE}/api/v2/srcmap" \
-H "Accept: application/json" \
-H "Content-Type: multipart/form-data" \
-H "DD-API-KEY: ${DD_API_KEY}"# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
export DD_API_KEY="<DD_API_KEY>"
curl -X POST "https://sourcemap-intake.${DD_SITE}/api/v2/srcmap" \
-H "Accept: application/json" \
-H "Content-Type: multipart/form-data" \
-H "DD-API-KEY: ${DD_API_KEY}"# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
export DD_API_KEY="<DD_API_KEY>"
curl -X POST "https://sourcemap-intake.${DD_SITE}/api/v2/srcmap" \
-H "Accept: application/json" \
-H "Content-Type: multipart/form-data" \
-H "DD-API-KEY: ${DD_API_KEY}"# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
export DD_API_KEY="<DD_API_KEY>"
curl -X POST "https://sourcemap-intake.${DD_SITE}/api/v2/srcmap" \
-H "Accept: application/json" \
-H "Content-Type: multipart/form-data" \
-H "DD-API-KEY: ${DD_API_KEY}"# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
export DD_API_KEY="<DD_API_KEY>"
curl -X POST "https://sourcemap-intake.${DD_SITE}/api/v2/srcmap" \
-H "Accept: application/json" \
-H "Content-Type: multipart/form-data" \
-H "DD-API-KEY: ${DD_API_KEY}"# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
export DD_API_KEY="<DD_API_KEY>"
curl -X POST "https://sourcemap-intake.${DD_SITE}/api/v2/srcmap" \
-H "Accept: application/json" \
-H "Content-Type: multipart/form-data" \
-H "DD-API-KEY: ${DD_API_KEY}"