소스 맵 업로드
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은 축소되거나 난독화된 코드 대신 읽기 쉬운 스택 트레이스를 표시할 수 있습니다.
요청 형식:
각 요청은 다음 두 부분으로 구성된 multipart/form-data 업로드입니다.
event— 업로드 메타데이터(유형, 서비스, 버전 등)가 포함된 JSON 인코딩 문자열- 하나 이상의 바이너리 파일 필드(예:
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: 소스 코드 연결을 위한 리포지토리 메타데이터
제한:
- 최대 파일 크기: 500MB
참고: 대부분의 사용 사례에서는 [Datadog CLI(datadog-ci)] (https://github.com/DataDog/datadog-ci/tree/master/src/commands/sourcemaps)를 사용하는 것이 좋은데, 소스 맵 업로드를 위한 간소화된 인터페이스를 제공하기 때문입니다.
요청
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}"