(record, metrics)
| 174 | // agent-runs.jsonl (schema 1): timestamp, event (agent-start, agent-complete, |
| 175 | // agent-fail, campaign-*, wave-*, agent-timeout), agent, status, campaign_slug. |
| 176 | function mapAgentRun(record, metrics) { |
| 177 | const nano = toUnixNano(record.timestamp); |
| 178 | if (!nano) return null; |
| 179 | if (typeof record.event !== 'string' || !record.event) return 0; |
| 180 | |
| 181 | metrics['citadel.agent.runs'].dataPoints.push({ |
| 182 | startTimeUnixNano: nano, |
| 183 | timeUnixNano: nano, |
| 184 | asInt: '1', |
| 185 | attributes: toAttributes({ |
| 186 | 'agent.name': record.agent || 'unknown', |
| 187 | 'run.event': record.event, |
| 188 | 'run.status': record.status || 'unknown', |
| 189 | 'campaign.slug': record.campaign_slug, |
| 190 | }), |
| 191 | }); |
| 192 | return 1; |
| 193 | } |
| 194 | |
| 195 | // Reads bytes appended since storedOffset. Returns only complete lines; an |
| 196 | // unterminated tail is included only when it already parses as JSON, otherwise |
nothing calls this directly
no test coverage detected