Datadog의 외형 모니터링을 수행합니다 (Terraform에서 시도)
개요
Datadog Synthetics API Tests 의 설정 방법을 정리했습니다. Terraform에서의 구축에 대해서도 기재하고 있습니다.
API Tests
Datadog Synthetics API Tests 에는 아래와 같이 기재되어 있습니다.
Google 번역
API 테스트는 API 엔드포인트를 모니터링하고 실패하거나 너무 느린 경우 경고하는 데 도움이 됩니다. 이러한 검사는 애플리케이션이 요청에 응답하고 응답 시간, HTTP 상태 코드, 헤더 또는 본문 내용 등 사용자가 정의한 조건을 충족하는지 확인합니다.
API Test에는
HTTP
와 SSL
의 2 종류가 있습니다.이번에는
HTTP
의 API를 테스트합니다.SSL
타입에 대해서는, 아래의 기사로 순서가 상세하게 설명되어 있으므로, 게재하겠습니다.이제 Datadog Synthetics API Tests에서 SSL 인증서 마감일을 모니터링할 수 있습니다! #datadog | DevelopersIO
또, AWS ACM을 이용하고 있는 경우, ACM 발행의 증명서의 자동 갱신 조건은 아래와 같이 확인할 수 있으므로, 참고로 해 주세요.
ACM의 Amazon에서 발급한 인증서의 관리형 업데이트
절차
Synthetics
> Get Started
> New API Test
를 선택합니다.
이번에는 다음 값을 설정합니다. URL은 필요에 따라 변경하십시오.
품목
값
요청 유형
HTTP
URL
GET htps : // 에어 mpぇ. 이 m
고급 옵션
-
이름
Test on example.com
Select your tags
-
Test URL
를 클릭합니다.
경고 조건이 자동으로 설정됩니다.
어설션이 실패하면 경고를 알립니다.

또한 화면 오른쪽에 테스트한 Request 및 Response 미리보기가 표시됩니다.

마지막으로
Notify your team
에 경고 메시지와 알림 대상을 지정합니다.이번에는 이미 Slack integrations 설정이 완료되었으므로 알림 대상에는 Slack channnel을 설정했습니다.

Create Test
를 클릭하면 테스트 설정이 완료됩니다.테스트 확인
테스트 상황은 화면에서 확인할 수 있습니다.
Properties

역사

Test Results
정상시

오류시


Slack에 알림
테스트가 실패하면 Slack에 대한 알림은 다음과 같습니다.


Terraform으로 구축
datadog_synthetics_test 로 구축합니다.
위의 단계에서 작성한 API Test를 Terraform으로 구축하면 다음과 같습니다.
resource "datadog_synthetics_test" "api_test" {
type = "api"
request = {
method = "GET"
url = "https://${var.api_test_url}"
}
assertions = [
{
type = "statusCode"
operator = "is"
target = "200"
},
{
type = "header"
property = "content-type"
operator = "is"
target = "application/json"
},
{
type = "responseTime"
operator = "lessThan"
target = "2000"
},
]
locations = ["aws:ap-northeast-1"]
options = {
tick_every = 60
}
name = "An API test on ${var.api_test_url}"
message = "Test on ${var.api_test_url} @${var.slack_channel_name}"
tags = []
status = "live"
}
덧붙여 SSL 타입에 대해서는 Terraform에서는 아직 대응되어 있지 않은 것 같습니다. (2019/6/16 시점에서는)
htps : // 기주 b. 코 m / 테라 후 rmp 로즈에서 rs / 테라 후 rmp 로즈로 r - 그대로 g / 이스에 s / 229
참고 기사
하기를 참고로 했습니다.
Synthetics API Tests(외형 감시) 기능을 사용해 보았다 #datadog | DevelopersIO
Reference
이 문제에 관하여(Datadog의 외형 모니터링을 수행합니다 (Terraform에서 시도)), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/kobayashi-m42/items/3afd657f8252b5366014텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)