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.
트레이스에 대해 호출별 사용량을 계산하고, 하위 호출까지 집계(롤업)하는 요청입니다.
이 엔드포인트는 트레이스 내 각 호출에 대한 사용량 메트릭을 반환하며, 각 호출의 메트릭에는 해당 호출 자체 사용량과 모든 하위 호출의 사용량 합계가 포함됩니다. 호출별로 집계된 메트릭을 확인해야 하는 트레이스 뷰에서 이 엔드포인트를 사용하십시오.
참고: 집계를 위해 조건과 일치하는 모든 호출이 메모리에 로드됩니다. 매우 큰 결과 집합(호출 1만 건 초과)의 경우, 더 구체적인 필터를 사용하거나 애플리케이션 레벨에서 페이지네이션을 구현하는 것을 고려하십시오.
성공적인 응답
호출별 사용량 메트릭에 대한 응답입니다(각 항목에는 하위 호출의 기여분이 포함됩니다).
표시 하위 속성