curl --request POST \
--url https://api.example.com/trace/usage \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"project_id": "<string>",
"filter": {
"op_names": [
"<string>"
],
"input_refs": [
"<string>"
],
"output_refs": [
"<string>"
],
"parent_ids": [
"<string>"
],
"trace_ids": [
"<string>"
],
"call_ids": [
"<string>"
],
"thread_ids": [
"<string>"
],
"turn_ids": [
"<string>"
],
"trace_roots_only": true,
"wb_user_ids": [
"<string>"
],
"wb_run_ids": [
"<string>"
]
},
"query": {
"$expr": {
"$and": [
{
"$literal": "<string>"
}
]
}
},
"include_costs": false,
"limit": 10000
}
'{
"call_usage": {}
}トレースごとに、子孫のロールアップを含めた呼び出し単位の使用量を計算します。
curl --request POST \
--url https://api.example.com/trace/usage \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"project_id": "<string>",
"filter": {
"op_names": [
"<string>"
],
"input_refs": [
"<string>"
],
"output_refs": [
"<string>"
],
"parent_ids": [
"<string>"
],
"trace_ids": [
"<string>"
],
"call_ids": [
"<string>"
],
"thread_ids": [
"<string>"
],
"turn_ids": [
"<string>"
],
"trace_roots_only": true,
"wb_user_ids": [
"<string>"
],
"wb_run_ids": [
"<string>"
]
},
"query": {
"$expr": {
"$and": [
{
"$literal": "<string>"
}
]
}
},
"include_costs": false,
"limit": 10000
}
'{
"call_usage": {}
}Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
トレース内の各コールについて、その子孫コールをロールアップした使用量を計算するためのリクエストです。
このエンドポイントは、トレース内の各コールに対する使用量メトリクスを返します。各コールのメトリクスには、そのコール自身の使用量に加えて、すべての子孫コールの使用量の合計が含まれます。コール単位でロールアップされたメトリクスを表示したいトレースビューで使用してください。
注意: 集計のために、条件にマッチしたすべてのコールがメモリに読み込まれます。結果セットが非常に大きい場合(>10k コール)には、より限定的なフィルターを使用するか、アプリケーション側でのページネーションを検討してください。
正常なレスポンス
コールごとの使用量メトリクス(各コールには子孫コールの寄与分も含まれます)を含むレスポンスです。
表示 子属性