- 필수 기능
- 시작하기
- Glossary
- 표준 속성
- Guides
- Agent
- 통합
- 개방형텔레메트리
- 개발자
- Administrator's Guide
- API
- Datadog Mobile App
- CoScreen
- Cloudcraft
- 앱 내
- 서비스 관리
- 인프라스트럭처
- 애플리케이션 성능
- APM
- Continuous Profiler
- 스팬 시각화
- 데이터 스트림 모니터링
- 데이터 작업 모니터링
- 디지털 경험
- 소프트웨어 제공
- 보안
- AI Observability
- 로그 관리
- 관리
서비스 점검 엔드포인트를 사용하면 점검 상태를 게시해 모니터에 사용할 수 있습니다. 서비스 점검 메시지는 500자로 제한되어 있습니다. 500자가 넘는 메시지는 첫 500자만 표시됩니다. 위험이나 경고 상태일 경우에만 메시지가 전송되고 정상 상태일 경우에는 전송되지 않습니다.
POST https://api.ap1.datadoghq.com/api/v1/check_runhttps://api.datadoghq.eu/api/v1/check_runhttps://api.ddog-gov.com/api/v1/check_runhttps://api.datadoghq.com/api/v1/check_runhttps://api.us3.datadoghq.com/api/v1/check_runhttps://api.us5.datadoghq.com/api/v1/check_run
Submit a list of Service Checks.
Notes:
Service Check request body.
[
{
"check": "app.ok",
"host_name": "host",
"status": 0,
"tags": [
"test:ExampleServiceCheck"
]
}
]
Payload accepted
The payload accepted for intake.
{
"status": "ok"
}
Bad Request
Error response object.
{
"errors": [
"Bad Request"
]
}
Authentication Error
Error response object.
{
"errors": [
"Bad Request"
]
}
Request timeout
Error response object.
{
"errors": [
"Bad Request"
]
}
Payload too large
Error response object.
{
"errors": [
"Bad Request"
]
}
Too many requests
Error response object.
{
"errors": [
"Bad Request"
]
}
# Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v1/check_run" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
[
{
"check": "app.ok",
"host_name": "host",
"status": 0,
"tags": [
"test:ExampleServiceCheck"
]
}
]
EOF
// Submit a Service Check returns "Payload accepted" response
package main
import (
"context"
"encoding/json"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV1"
)
func main() {
body := []datadogV1.ServiceCheck{
{
Check: "app.ok",
HostName: "host",
Status: datadogV1.SERVICECHECKSTATUS_OK,
Tags: []string{
"test:ExampleServiceCheck",
},
},
}
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV1.NewServiceChecksApi(apiClient)
resp, r, err := api.SubmitServiceCheck(ctx, body)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ServiceChecksApi.SubmitServiceCheck`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `ServiceChecksApi.SubmitServiceCheck`:\n%s\n", responseContent)
}
First install the library and its dependencies and then save the example to main.go
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" go run "main.go"
// Submit a Service Check returns "Payload accepted" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v1.api.ServiceChecksApi;
import com.datadog.api.client.v1.model.IntakePayloadAccepted;
import com.datadog.api.client.v1.model.ServiceCheck;
import com.datadog.api.client.v1.model.ServiceCheckStatus;
import java.util.Collections;
import java.util.List;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
ServiceChecksApi apiInstance = new ServiceChecksApi(defaultClient);
List<ServiceCheck> body =
Collections.singletonList(
new ServiceCheck()
.check("app.ok")
.hostName("host")
.status(ServiceCheckStatus.OK)
.tags(Collections.singletonList("test:ExampleServiceCheck")));
try {
IntakePayloadAccepted result = apiInstance.submitServiceCheck(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ServiceChecksApi#submitServiceCheck");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
First install the library and its dependencies and then save the example to Example.java
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" java "Example.java"
from datadog import initialize, api
from datadog.api.constants import CheckStatus
options = {'api_key': '<DATADOG_API_KEY>',
'app_key': '<DATADOG_APPLICATION_KEY>'}
initialize(**options)
check = 'app.ok'
host = 'app1'
status = CheckStatus.OK # equals 0
tags = ['env:test']
api.ServiceCheck.check(check=check, host_name=host, status=status, message='Response: 200 OK', tags=tags)
First install the library and its dependencies and then save the example to example.py
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" python "example.py"
"""
Submit a Service Check returns "Payload accepted" response
"""
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.service_checks_api import ServiceChecksApi
from datadog_api_client.v1.model.service_check import ServiceCheck
from datadog_api_client.v1.model.service_check_status import ServiceCheckStatus
from datadog_api_client.v1.model.service_checks import ServiceChecks
body = ServiceChecks(
[
ServiceCheck(
check="app.ok",
host_name="host",
status=ServiceCheckStatus.OK,
tags=[
"test:ExampleServiceCheck",
],
),
]
)
configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = ServiceChecksApi(api_client)
response = api_instance.submit_service_check(body=body)
print(response)
First install the library and its dependencies and then save the example to example.py
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" python3 "example.py"
require 'rubygems'
require 'dogapi'
api_key = '<DATADOG_API_KEY>'
app_key = '<DATADOG_APPLICATION_KEY>'
dog = Dogapi::Client.new(api_key, app_key)
# submitting a check doesn't require an app_key
dog = Dogapi::Client.new(api_key)
dog.service_check('app.is_ok', 'app1', 0, :message => 'Response: 200 OK', :tags => ['env:test'])
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" rb "example.rb"
# Submit a Service Check returns "Payload accepted" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V1::ServiceChecksAPI.new
body = [
DatadogAPIClient::V1::ServiceCheck.new({
check: "app.ok",
host_name: "host",
status: DatadogAPIClient::V1::ServiceCheckStatus::OK,
tags: [
"test:ExampleServiceCheck",
],
}),
]
p api_instance.submit_service_check(body)
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" rb "example.rb"
// Submit a Service Check returns "Payload accepted" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV1::api_service_checks::ServiceChecksAPI;
use datadog_api_client::datadogV1::model::ServiceCheck;
use datadog_api_client::datadogV1::model::ServiceCheckStatus;
#[tokio::main]
async fn main() {
let body = vec![ServiceCheck::new(
"app.ok".to_string(),
"host".to_string(),
ServiceCheckStatus::OK,
vec!["test:ExampleServiceCheck".to_string()],
)];
let configuration = datadog::Configuration::new();
let api = ServiceChecksAPI::with_config(configuration);
let resp = api.submit_service_check(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
First install the library and its dependencies and then save the example to src/main.rs
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" cargo run
/**
* Submit a Service Check returns "Payload accepted" response
*/
import { client, v1 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v1.ServiceChecksApi(configuration);
const params: v1.ServiceChecksApiSubmitServiceCheckRequest = {
body: [
{
check: "app.ok",
hostName: "host",
status: 0,
tags: ["test:ExampleServiceCheck"],
},
],
};
apiInstance
.submitServiceCheck(params)
.then((data: v1.IntakePayloadAccepted) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
First install the library and its dependencies and then save the example to example.ts
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" tsc "example.ts"