RecordStreamRetry increments stream_retries_total. The caller must obtain classified via chaterror.Classify (non-empty Kind). No-op when m is nil. The chain_broken label is "true" for chain anchor failures (e.g. OpenAI previous_response_id 404) recovered by the chatloop, and "false" otherwise.
(provider, model string, classified chaterror.ClassifiedError)
| 145 | // anchor failures (e.g. OpenAI previous_response_id 404) recovered |
| 146 | // by the chatloop, and "false" otherwise. |
| 147 | func (m *Metrics) RecordStreamRetry(provider, model string, classified chaterror.ClassifiedError) { |
| 148 | if m == nil { |
| 149 | return |
| 150 | } |
| 151 | m.StreamRetriesTotal.WithLabelValues( |
| 152 | provider, |
| 153 | model, |
| 154 | string(classified.Kind), |
| 155 | strconv.FormatBool(classified.ChainBroken), |
| 156 | ).Inc() |
| 157 | } |
| 158 | |
| 159 | // RecordToolError increments tool_errors_total for the given |
| 160 | // tool. No-op when m is nil. |