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.
하위 호출을 포함해 트레이스의 호출 단위 사용량(per-call usage)을 계산하는 엔드포인트입니다.
이 엔드포인트는 트레이스 내 각 호출에 대한 사용량 메트릭을 반환합니다. 각 호출의 메트릭에는 해당 호출 자체의 사용량과 모든 하위(자식) 호출의 사용량 합계가 포함됩니다. 호출 단위로 롤업된 메트릭을 보고 싶은 트레이스 뷰에서 이 엔드포인트를 사용하십시오.
참고: 집계를 위해 조건에 맞는 모든 호출이 메모리로 로드됩니다. 결과 집합이 매우 큰 경우(호출 수가 10,000개 이상인 경우) 더 구체적인 필터를 사용하거나 애플리케이션 레벨에서 페이지네이션을 적용하는 것을 고려하십시오.
호출을 선택하는 데 사용하는 필터입니다. 일반적으로 trace_ids를 사용해 하나의 트레이스에 포함된 모든 호출을 가져옵니다.
Show child attributes
호출을 필터링하기 위한 추가 쿼리 조건입니다.
Show child attributes
값이 true이면 사용량에 대한 비용 계산을 포함합니다.
처리할 수 있는 최대 호출 수입니다. 무제한적인 메모리 사용을 방지하기 위한 안전 한도 역할을 합니다.
성공 응답
호출별 사용량 메트릭에 대한 응답입니다(각 항목에는 하위 호출의 기여분이 포함됨).
Show child attributes