- 重要な情報
- はじめに
- 用語集
- ガイド
- エージェント
- インテグレーション
- OpenTelemetry
- 開発者
- API
- CoScreen
- アプリ内
- Service Management
- インフラストラクチャー
- アプリケーションパフォーマンス
- 継続的インテグレーション
- ログ管理
- セキュリティ
- UX モニタリング
- 管理
v1 API のユーザーは、v2 時間単位使用量 API でおなじみの概念を、若干異なるフォーマットで表現していることを認識できるはずです。
v1 API と v2 API の最も顕著な相違点は、v2 API の次の点です。
それぞれの違いについては、以下のセクションでさらに詳しく説明します。
v2 API では、製品ファミリーと使用量という概念が導入されています。製品ファミリーは、1 つまたは複数の使用量をグループ化したものです。使用量タイプは、特定の組織および期間での使用量の測定値です。製品ファミリーの初期セットは、v1 API とほぼ一致しており、完全なマッピングは以下のとおりです。また、他のすべての製品ファミリーの使用量を取得する特別な all
製品ファミリーがあります。
ファミリーと使用量タイプ:
analyzed_logs
app_sec_host_count
enabled
func_count
invocations_sum
ci_pipeline_indexed_spans
ci_test_indexed_spans
ci_visibility_pipeline_committers
ci_visibility_test_committers
host_count
aas_host_count
azure_host_count
compliance_host_count
container_count
host_count
cws_container_count
cws_host_count
dbm_host_count
dbm_queries_count
avg_profiled_fargate_tasks
tasks_count
agent_host_count
alibaba_host_count
apm_azure_app_service_host_count
apm_host_count
aws_host_count
azure_host_count
container_count
gcp_host_count
heroku_host_count
host_count
infra_azure_app_service
opentelemetry_host_count
vsphere_host_count
monthly_active_users
logs_indexed_events_3_day_count
logs_live_indexed_events_3_day_count
logs_rehydrated_indexed_events_3_day_count
logs_indexed_events_7_day_count
logs_live_indexed_events_7_day_count
logs_rehydrated_indexed_events_7_day_count
logs_indexed_events_15_day_count
logs_live_indexed_events_15_day_count
logs_rehydrated_indexed_events_15_day_count
logs_indexed_events_30_day_count
logs_live_indexed_events_30_day_count
logs_rehydrated_indexed_events_30_day_count
logs_indexed_events_45_day_count
logs_live_indexed_events_45_day_count
logs_rehydrated_indexed_events_45_day_count
logs_indexed_events_60_day_count
logs_live_indexed_events_60_day_count
logs_rehydrated_indexed_events_60_day_count
logs_indexed_events_90_day_count
logs_live_indexed_events_90_day_count
logs_rehydrated_indexed_events_90_day_count
logs_indexed_events_180_day_count
logs_live_indexed_events_180_day_count
logs_rehydrated_indexed_events_180_day_count
logs_indexed_events_360_day_count
logs_live_indexed_events_360_day_count
logs_rehydrated_indexed_events_360_day_count
logs_indexed_events_custom_day_count
logs_live_indexed_events_custom_day_count
logs_rehydrated_indexed_events_custom_day_count
indexed_events_count
ingested_spans
ingested_events_bytes
iot_device_count
lambda_traced_invocations_count
billable_ingested_bytes
indexed_events_count
ingested_events_bytes
logs_forwarding_events_bytes
logs_live_indexed_count
logs_live_ingested_bytes
logs_rehydrated_indexed_count
logs_rehydrated_ingested_bytes
indexed_events_count
host_count
observability_pipelines_bytes_processed
online_archive_events_count
avg_container_agent_count
host_count
browser_rum_units
mobile_rum_units
rum_units
replay_session_count
session_count
session_count
session_count_android
session_count_ios
session_count_reactnative
session_count_flutter
logs_scanned_bytes
total_scanned_bytes
snmp_devices
check_calls_count
browser_check_calls_count
num_custom_input_timeseries
num_custom_output_timeseries
num_custom_timeseries
このリストは、上記のファミリーと使用量タイプが、v1 時間単位使用量エンドポイントにどのようにマッピングされるかを示しています。使用量とデータポイントは、特に明記されている場合を除き、同じです。
<base_url>/api/v1/usage/hosts
| infra_hostsagent_host_count
alibaba_host_count
apm_azure_app_service_host_count
apm_host_count
aws_host_count
azure_host_count
container_count
gcp_host_count
heroku_host_count
host_count
infra_azure_app_service
opentelemetry_host_count
vsphere_host_count
<base_url>/api/v1/usage/logs
| logsbillable_ingested_bytes
indexed_events_count
ingested_events_bytes
logs_live_indexed_count
logs_live_ingested_bytes
logs_rehydrated_indexed_count
logs_rehydrated_ingested_bytes
<base_url>/api/v1/usage/timeseries
| timeseriesnum_custom_input_timeseries
num_custom_output_timeseries
num_custom_timeseries
<base_url>/api/v1/usage/indexed-spans
| indexed_spansindexed_events_count
<base_url>/api/v1/usage/synthetics
<base_url>/api/v1/usage/synthetics_api
| synthetics_apicheck_calls_count
<base_url>/api/v1/usage/synthetics_browser
| synthetics_browserbrowser_check_calls_count
<base_url>/api/v1/usage/fargate
| fargateavg_profiled_fargate_tasks
tasks_count
<base_url>/api/v1/usage/aws_lambda
| serverlessfunc_count
invocations_sum
<base_url>/api/v1/usage/rum_sessions?type=browser
| rum_browser_sessionsreplay_session_count
session_count
<base_url>/api/v1/usage/rum_sessions?type=mobile
| rum_mobile_sessionssession_count
session_count_android
session_count_ios
session_count_reactnative
<base_url>/api/v1/usage/network_hosts
| network_hostshost_count
<base_url>/api/v1/usage/network_flows
| network_flowsindexed_events_count
<base_url>/api/v1/usage/logs-by-retention
| indexed_logslogs_indexed_events_<retention>_count
データポイント: indexed_events_count
logs_live_indexed_events_<retention>_count
データポイント: live_indexed_events_count
logs_rehydrated_indexed_events_<retention>_count
データポイント: rehydrated_indexed_events_count
usage_type
では、<retention>
を次のいずれかに置き換えてください: 3_day
、7_day
、15_day
、30_day
、45_day
、60_day
、90_day
、180_day
、365_day
、custom
データポイント: retention
<base_url>/api/v1/usage/analyzed_logs
| analyzed_logsanalyzed_logs
<base_url>/api/v1/usage/snmp
| snmpsnmp_devices
<base_url>/api/v1/usage/profiling
| profilinghost_count
<base_url>/api/v1/usage/ingested-spans
| ingested_spansingested_events_bytes
<base_url>/api/v1/usage/incident-management
| incident_managementmonthly_active_users
<base_url>/api/v1/usage/iot
| iotiot_device_count
<base_url>/api/v1/usage/cspm
| cspmaas_host_count
azure_host_count
compliance_host_count
container_count
host_count
<base_url>/api/v1/usage/audit_logs
| audit_logslines_indexed
<base_url>/api/v1/usage/cws
| cwscws_container_count
cws_host_count
<base_url>/api/v1/usage/dbm
| dbmdbm_host_count
dbm_queries_count
<base_url>/api/v1/usage/sds
| sdslogs_scanned_bytes
total_scanned_bytes
<base_url>/api/v1/usage/rum
| rumbrowser_rum_units
mobile_rum_units
rum_units
<base_url>/api/v1/usage/ci-app
| ci_appci_pipeline_indexed_spans
ci_test_indexed_spans
ci_visibility_pipeline_committers
ci_visibility_test_committers
<base_url>/api/v1/usage/online-archive
| online_archiveonline_archive_events_count
<base_url>/api/v2/usage/lambda_traced_invocations
| lambda_traced_invocationslambda_traced_invocations_count
<base_url>/api/v2/usage/application_security
| application_securityapp_sec_host_count
<base_url>/api/v2/usage/observability_pipelines
| observability_pipelinesobservability_pipelines_bytes_processed
レスポンス本文およびパラメーター名は、JSON:API 仕様に準拠しています。v1 API で利用可能なすべてのデータは、引き続き利用可能です。v1 のホスト API から v2 の時間単位使用量 API へのマッピングの例は以下をご参照ください。
https://api.datadoghq.com/api/v1/usage/hosts?start_hr=2022-06-01T00&end_hr=2022-06-01T01
hosts
の要素です。start_hr
と end_hr
で制御されます。{
"usage": [
{
"agent_host_count": 1,
"alibaba_host_count": 2,
"apm_azure_app_service_host_count": 3,
"apm_host_count": 4,
"aws_host_count": 5,
"azure_host_count": 6,
"container_count": 7,
"gcp_host_count": 8,
"heroku_host_count": 9,
"host_count": 10,
"infra_azure_app_service": 11,
"opentelemetry_host_count": 12,
"vsphere_host_count": 13,
"hour": "2022-06-01T00",
"org_name": "Customer Inc",
"public_id": "abc123"
}
]
}
https://api.datadoghq.com/api/v2/usage/hourly_usage?filter[timestamp][start]=2022-06-01T00&filter[timestamp][end]=2022-06-01T01&filter[product_families]=infra_hosts
filter[product_families]=infra_hosts
として渡されます。filter[timestamp][start]
と filter[timestamp][end]
によって制御されます。{
"data": [
{
"attributes": {
"org_name": "Customer Inc",
"public_id": "abc123",
"timestamp": "2022-06-01T00:00:00+00:00",
"region": "us",
"measurements": [
{
"usage_type": "agent_host_count",
"value": 1
},
{
"usage_type": "alibaba_host_count",
"value": 2
},
{
"usage_type": "apm_azure_app_service_host_count",
"value": 3
},
{
"usage_type": "apm_host_count",
"value": 4
},
{
"usage_type": "aws_host_count",
"value": 5
},
{
"usage_type": "azure_host_count",
"value": 6
},
{
"usage_type": "container_count",
"value": 7
},
{
"usage_type": "gcp_host_count",
"value": 8
},
{
"usage_type": "heroku_host_count",
"value": 9
},
{
"usage_type": "host_count",
"value": 10
},
{
"usage_type": "infra_azure_app_service",
"value": 11
},
{
"usage_type": "opentelemetry_host_count",
"value": 12
},
{
"usage_type": "vsphere_host_count",
"value": 13
}
],
"product_family": "infra_hosts"
},
"type": "usage_timeseries",
"id": "ec3e0318b98d15c2ae8125e8bda0ff487cd08d80b120fb340c9322ee16f28629"
}
]
}
measurements
配列で表現されます。usage_type
と value
というフィールドを持ちます。hour
、org_name
、public_id
は attributes
オブジェクトのフィールドでもあります。v2 時間単位使用量 API はページ分割されます。レスポンスは 500 ページに制限され、1 ページには 1 製品ファミリー、1 時間、1 組織の使用量データが含まれます。ページ区切りにより、API はリクエストごとの複数製品、リクエストごとの複数組織、無制限の時間範囲などの他の機能をサポートすることができます。
もし結果が複数のページを持つ場合、次のページのレコード ID が meta.pagination.next_record_id
フィールドで返されます。クライアントはその ID をパラメーター pagination[next_record_id]
に渡す必要があります。meta.pagination.next_record_id
フィールドが設定されていない場合は、これ以上取得するページはありません。
response := GetHourlyUsage(start_time, end_time, product_families)
cursor := response.metadata.pagination.next_record_id
WHILE cursor != null BEGIN
sleep(5 seconds) # レートリミットを回避する
response := GetHourlyUsage(start_time, end_time, product_families, next_record_id=cursor)
cursor := response.metadata.pagination.next_record_id
END
v2 API では、1 回のリクエストで全地域の子組織の使用量データを取得することができます。子組織のデータをリクエストするには、パラメーター filter[include_descendants]
を使用します。
お役に立つドキュメント、リンクや記事: