";let n=document.getElementById("TableOfContents");n&&(n.innerHTML=e)}rerender(){this.renderFilterMenu(),this.renderPageContent(),this.populateRightNav(),this.runHooks("afterRerender")}renderPageContent(){let e={};Object.keys(this.ifFunctionsByRef).forEach(t=>{let s=this.ifFunctionsByRef[t],o=s.value,n=(0,h.reresolveFunctionNode)(s,{variables:this.selectedValsByTraitId});this.ifFunctionsByRef[t]=n,o!==n.value&&(e[t]=n.value)});let t=document.getElementsByClassName("cdoc__toggleable");for(let n=0;n{this.fitCustomizationMenuToScreen()})}addDropdownEventListeners(){let e=document.getElementsByClassName("cdoc-dropdown");for(let t=0;t{let t=e.target;for(;!t.classList.contains("cdoc-dropdown")&&t.parentElement;)t=t.parentElement;let n=t.classList.toggle("cdoc-dropdown__expanded");t.setAttribute("aria-expanded",n.toString())});document.addEventListener("keydown",e=>{if(e.key==="Enter"){let t=e.target;t.classList.contains("cdoc-filter__option")&&t.click()}}),document.addEventListener("click",t=>{for(let n=0;nthis.handleFilterSelectionChange(e));this.addDropdownEventListeners()}locateFilterSelectorEl(){let e=document.getElementById("cdoc-selector");return!!e&&(this.filterSelectorEl=e,!0)}applyFilterSelectionOverrides(){let s=Object.keys(this.selectedValsByTraitId),e=!1,t=this.browserStorage.getTraitVals();Object.keys(t).forEach(n=>{s.includes(n)&&this.selectedValsByTraitId[n]!==t[n]&&(this.selectedValsByTraitId[n]=t[n],e=!0)});let n=(0,j.getTraitValsFromUrl)({url:new URL(window.location.href),traitIds:s});return Object.keys(n).forEach(t=>{this.selectedValsByTraitId[t]!==n[t]&&(this.selectedValsByTraitId[t]=n[t],e=!0)}),e}updateEditButton(){let t=document.getElementsByClassName("toc-edit-btn")[0];if(!t)return;let e=t.getElementsByTagName("a")[0];e&&(e.href=e.href.replace(/\.md\/$/,".mdoc.md/"))}revealPage(){this.runHooks("beforeReveal"),this.filterSelectorEl&&(this.filterSelectorEl.style.position="sticky",this.filterSelectorEl.style.backgroundColor="white",this.filterSelectorEl.style.paddingTop="10px",this.filterSelectorEl.style.visibility="visible",this.filterSelectorEl.style.zIndex="1000");let e=document.getElementById("cdoc-content");e&&(e.style.visibility="visible"),this.runHooks("afterReveal")}renderFilterMenu(){if(!this.filterSelectorEl||!this.filtersManifest)throw new Error("Cannot render filter selector without filtersManifest and filterSelectorEl");let e=(0,l.resolveFilters)({filtersManifest:this.filtersManifest,valsByTraitId:this.selectedValsByTraitId});Object.keys(e).forEach(t=>{let n=e[t];this.selectedValsByTraitId[t]=n.currentValue});let t=(0,y.buildCustomizationMenuUi)(e);this.filterSelectorEl.innerHTML=t,this.fitCustomizationMenuToScreen(),this.addFilterSelectorEventListeners()}fitCustomizationMenuToScreen(){let e=document.getElementById(g);if(!e)return;let s=e.classList.contains(n),t=document.getElementById(v);if(!t)throw new Error("Dropdown menu not found");let o=document.getElementById(b);if(!o)throw new Error("Menu wrapper not found");let i=e.scrollWidth>o.clientWidth;!s&&i?(e.classList.add(n),t.classList.remove(n)):s&&!i&&(e.classList.remove(n),t.classList.add(n))}get cdocsState(){return{selectedValsByTraitId:this.selectedValsByTraitId,ifFunctionsByRef:this.ifFunctionsByRef,filtersManifest:this.filtersManifest,browserStorage:this.browserStorage,filterSelectorEl:this.filterSelectorEl}}};e.ClientFiltersManager=r,t=r,s={value:0[0]}}),y=e(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=j();window.clientFiltersManager=t.ClientFiltersManager.instance}),y()})()다단계 API 테스트
다단계 API 테스트의 Locations를 선택합니다. 다단계 API 테스트는 네트워크 외부 또는 내부에서 테스트를 실행하는 선호도에 따라 관리되는 위치 및 프라이빗 위치에서 모두 실행할 수 있습니다.
Datadog’s out-of-the-box managed locations allow you to test public-facing websites and endpoints from regions where your customers are located.
AWS:
Americas
Asia Pacific
EMEA
Canada Central
Hong Kong
Bahrain
Northern California
Jakarta
Cape Town
Northern Virginia
Mumbai
Frankfurt
Ohio
Osaka
Ireland
Oregon
Seoul
London
São Paulo
Singapore
Milan
Sydney
Paris
Tokyo
Stockholm
GCP:
Americas
Asia Pacific
EMEA
Dallas
Tokyo
Frankfurt
Los Angeles
Oregon
Virginia
Azure:
Region
Location
Americas
Virginia
The Datadog for Government site (US1-FED) uses the following managed location:
Region
Location
Americas
US-West
단계 정의
API 요청 단계를 만들려면 첫 번째 단계 생성을 클릭합니다.
기본적으로 테스트 단계는 최대 10개까지 생성할 수 있습니다. 이 제한을 늘리려면 Datadog 지원팀에 문의하세요.
요청 정의
단계에 이름을 지정하세요.
요청 유형으로 HTTP 또는 gRPC를 선택합니다.
HTTP 요청을 생성하고 어설션을 추가하려면 HTTP 테스트 설명서를 참조하세요. 어설션은 다단계 API 테스트에서 선택적입니다.
gRPC 요청을 만들고 동작 점검 또는 상태 점검에 대한 어설션을 추가하려면 gRPC 테스트 설명서를 참조하세요. 어설션은 다단계 API 테스트에서 선택적입니다.
실행 설정 추가
실행 설정에서 다음 옵션을 사용할 수 있습니다.
단계 성공:
단계가 성공하면 다음 단계로 계속을 클릭하여 단계 성공 후 다음 단계로 테스트를 진행합니다.
단계를 성공적으로 완료한 후 테스트를 종료하려면 단계가 성공하면 테스트를 종료하고 성공으로 표시를 클릭합니다. 이렇게 하면 불필요한 단계가 실행되는 것을 방지하고 테스트가 실패로 표시되는 것을 방지할 수 있습니다.
단계 실패
단계 실패 후 후속 단계를 진행하려면 단계 실패 시 다음 단계로 계속을 클릭합니다. 이 기능은 후속 단계를 진행하려는 정리 작업에 유용할 수 있습니다. 예를 들어, 테스트에서 리소스를 만들고 해당 리소스에 대해 여러 작업을 수행한 다음 해당 리소스를 삭제하는 것으로 끝낼 수 있습니다.
중간 단계 중 하나가 실패하는 경우, 테스트가 끝날 때 리소스가 삭제되고 오탐이 생성되지 않도록 모든 중간 단계에서 이 설정을 사용하도록 설정할 수 있습니다.
엔드포인트가 예상대로 응답하지 않으면 테스트에서 알림을 생성합니다. 테스트 결과가 실패한 경우 테스트는 Y 밀리초후 X회 재시도를 트리거할 수 있습니다. 알림 민감도에 맞게 재시도 간격을 사용자 지정할 수 있습니다.
응답에서 변수 추출
선택 사항으로 API 요청의 응답에서 파싱 응답 헤더 또는 본문에서 변수를 추출합니다. 변수의 값은 API 요청 단계가 실행될 때마다 업데이트됩니다.
변수에 대한 파싱을 시작하려면, 응답 콘텐츠에서 변수 추출을 클릭하세요:
변수 이름을 입력합니다. 변수 이름은 대문자, 숫자, 밑줄만 사용할 수 있으며 세 글자 이상이어야 합니다.
응답 헤더에서 변수를 추출할지, 응답 본문에서 추출할지 결정합니다.
응답 헤더에서 값 추출: API 요청의 전체 응답 헤더를 변수 값으로 사용하거나 regex로 파싱합니다.
응답 본문에서 값 추출: API 요청의 전체 응답 본문을 변수 값으로 사용하거나 regex, JSONPath 또는 XPath로 파싱합니다.
테스트 단계당 최대 10개의 변수를 추출할 수 있습니다. 생성된 변수는 다단계 API 테스트의 다음 단계에서 사용할 수 있습니다. 자세한 내용은 변수 사용을 참조하세요.
테스트 빈도 지정
다단계 API 테스트는 다음을 실행할 수 있습니다.
일정에 따라 사용자가 가장 중요한 엔드포인트에 항상 액세스할 수 있도록 보장합니다. Datadog이 다단계 API 테스트를 실행할 빈도를 선택하세요.
CI/CD 파이프라인 내에 결함이 있는 코드가 고객 경험에 영향을 미칠지에 대한 염려 없이 출시를 시작할 수 있습니다.
온디맨드로 팀에 가장 적합한 시간에 테스트를 실행할 수 있습니다.
Define alert conditions
Set alert conditions to determine the circumstances under which you want a test to fail and trigger an alert.
Alerting rule
When you set the alert conditions to: An alert is triggered if any assertion fails for X minutes from any n of N locations, an alert is triggered only if these two conditions are true:
At least one location was in failure (at least one assertion failed) during the last X minutes;
At one moment during the last X minutes, at least n locations were in failure.
Fast retry
Your test can trigger retries X times after Y ms in case of a failed test result. Customize the retry interval to suit your alerting sensibility.
Location uptime is computed on a per-evaluation basis (whether the last test result before evaluation was up or down). The total uptime is computed based on the configured alert conditions. Notifications sent are based on the total uptime.
Configure the test monitor
A notification is sent by your test based on the alerting conditions previously defined. Use this section to define how and what to message your team.
Similar to how you configure monitors, select users and/or services that should receive notifications either by adding an @notification to the message or by searching for team members and connected integrations with the dropdown menu.
Enter the notification message for your test or use pre-filled monitor messages. This field allows standard Markdown formatting and supports the following conditional variables:
Conditional Variable
Description
{{#is_alert}}
Show when the test alerts.
{{^is_alert}}
Show unless the test alerts.
{{#is_recovery}}
Show when the test recovers from alert.
{{^is_recovery}}
Show unless the test recovers from alert.
{{#is_renotify}}
Show when the monitor renotifies.
{{^is_renotify}}
Show unless the monitor renotifies.
{{#is_priority}}
Show when the monitor matches priority (P1 to P5).
{{^is_priority}}
Show unless the monitor matches priority (P1 to P5).
Notification messages include the message defined in this section and information about the failing locations. Pre-filled monitor messages are included in the message body section:
Specify how often you want your test to re-send the notification message in case of test failure. To prevent renotification on failing tests, check the option Stop re-notifying on X occurrences.
Click Save & Start Recording to save your test configuration and monitor.
To create a local variable, click + All steps > Variables. You can select one of the following available builtins to add to your variable string:
{{ numeric(n) }}
Generates a numeric string with n digits.
{{ alphabetic(n) }}
Generates an alphabetic string with n letters.
{{ alphanumeric(n) }}
Generates an alphanumeric string with n characters.
{{ date(n unit, format) }}
Generates a date in one of Datadog’s accepted formats with a value corresponding to the UTC date the test is initiated at + or - n units.
{{ timestamp(n, unit) }}
Generates a timestamp in one of Datadog’s accepted units with a value corresponding to the UTC timestamp the test is initiated at +/- n units.
{{ uuid }}
Generates a version 4 universally unique identifier (UUID).
{{ public-id }}
Injects the Public ID of your test.
{{ result-id }}
Injects the Result ID of your test run.
To obfuscate local variable values in test results, select Hide and obfuscate variable value. Once you have defined the variable string, click Add Variable.
요청을 적절한 시간 내에 완료할 수 없습니다. 두 가지 유형의 TIMEOUT이 발생할 수 있습니다:
TIMEOUT: The request couldn't be completed in a reasonable time.는 요청 기간이 테스트에 정의된 시간 제한에 도달했음을 나타냅니다(기본값은 60초로 설정됨).
각 요청에 대해 완료된 요청 단계만 네트워크 폭포에 표시됩니다. 예를 들어, Total response time만 표시되는 경우 DNS 확인 중에 시간 초과가 발생했습니다.
TIMEOUT: Overall test execution couldn't be completed in a reasonable time.는 요청 및 어설션 기간이 최대 기간(30분)에 도달했음을 나타냅니다.
기본적으로 Datadog 관리자 및 Datadog 표준 역할을 가진 사용자만 신서틱(Synthetic) 멀티스텝 API 테스트를 만들고, 편집하고, 삭제할 수 있습니다. 신서틱(Synthetic) 다단계 API 테스트에 대한 생성, 편집 및 삭제 액세스 권한을 얻으려면 사용자를 이 두 기본 역할 중 하나로 업그레이드하세요.
커스텀 역할 기능을 사용하는 경우 신서틱(Synthetic) 모니터링에 대한 synthetics_read 및 synthetics_write 권한이 포함된 커스텀 역할에 사용자를 추가합니다.