feat: add agent workflow metrics collection

Add comprehensive OpenTelemetry-based metrics for agent observability:

- Workflow completion/failure tracking with duration measurements
- Step execution counters for performance monitoring
- Tool usage tracking with normalized tool names
- Non-blocking telemetry emission with named async tasks
- Comprehensive unit and integration test coverage
- Graceful handling when telemetry is disabled
This commit is contained in:
skamenan7 2025-08-06 17:08:03 -04:00
parent 4c2fcb6b51
commit 69b692af91
13 changed files with 701 additions and 11 deletions

View file

@ -13616,6 +13616,10 @@
"unit": {
"type": "string",
"description": "The unit of measurement for the metric value"
},
"metric_type": {
"$ref": "#/components/schemas/MetricType",
"description": "The type of metric (optional, inferred if not provided for backwards compatibility)"
}
},
"additionalProperties": false,
@ -13631,6 +13635,17 @@
"title": "MetricEvent",
"description": "A metric event containing a measured value."
},
"MetricType": {
"type": "string",
"enum": [
"counter",
"up_down_counter",
"histogram",
"gauge"
],
"title": "MetricType",
"description": "The type of metric being recorded."
},
"SpanEndPayload": {
"type": "object",
"properties": {