()
| 86 | } |
| 87 | |
| 88 | const providerHttpErrorsQuery = () => { |
| 89 | const filters = [ |
| 90 | { column: "provider", op: "exists" }, |
| 91 | { column: "user_agent", op: "contains", value: "opencode" }, |
| 92 | ] |
| 93 | const successHttpStatus = calculatedField({ |
| 94 | name: "is_success_http_status", |
| 95 | expression: `IF(AND(GTE($status, "200"), LT($status, "400")), 1, 0)`, |
| 96 | }) |
| 97 | const failedProviderHttpStatus = calculatedField({ |
| 98 | name: "is_failed_provider_http_status", |
| 99 | expression: `IF(GT($llm.error.code, "400"), 1, 0)`, |
| 100 | }) |
| 101 | |
| 102 | return honeycombio.getQuerySpecificationOutput({ |
| 103 | breakdowns: ["provider"], |
| 104 | calculatedFields: [successHttpStatus, failedProviderHttpStatus], |
| 105 | calculations: [ |
| 106 | { |
| 107 | op: "SUM", |
| 108 | name: "SUCCESS", |
| 109 | column: successHttpStatus.name, |
| 110 | filterCombination: "AND", |
| 111 | filters: [...filters, { column: "event_type", op: "=", value: "completions" }], |
| 112 | }, |
| 113 | { |
| 114 | op: "SUM", |
| 115 | name: "FAILED", |
| 116 | column: failedProviderHttpStatus.name, |
| 117 | filterCombination: "AND", |
| 118 | filters: [ |
| 119 | ...filters, |
| 120 | { column: "event_type", op: "=", value: "llm.error" }, |
| 121 | { column: "llm.error.code", op: "!=", value: "404" }, |
| 122 | ], |
| 123 | }, |
| 124 | ], |
| 125 | formulas: [ |
| 126 | { name: "ERROR", expression: "IF(GTE(SUM($SUCCESS, $FAILED), 150), DIV($FAILED, SUM($SUCCESS, $FAILED)), 0)" }, |
| 127 | ], |
| 128 | timeRange: 900, |
| 129 | }).json |
| 130 | } |
| 131 | |
| 132 | const modelLowTpsQuery = (product: "go" | "zen") => { |
| 133 | const filters = [ |
no test coverage detected