ארבע שכבות
1. Traces (OpenTelemetry GenAI conventions)
כל LLM-call - span עם attributes: gen_ai.system, gen_ai.request.model, gen_ai.usage.input_tokens, gen_ai.usage.output_tokens, gen_ai.response.finish_reason. RAG retrieval - span נפרד. Agentic chain - span אב עם child spans על כל tool call.
2. Metrics
Token usage per tenant (cost control). Latency P50/P95/P99 per endpoint. RAG recall@5 ו-hit rate. Refusal rate. Cost per conversation. Export ל-Prometheus / Datadog.
3. Logs (structured)
Full conversation log עם PII redaction. Source citations לכל תשובה. User feedback. Refusal reason. Retention 7 שנים ל-regulated.
4. Evals (offline + online)
Offline: golden dataset עם ground truth, evaluation אוטומטי על כל deploy. Online: LLM-as-judge על sample 1%. מטריקות: factual accuracy, helpfulness, safety, citation correctness.
Production setup
- OpenTelemetry .NET SDK + GenAI extension.
- Custom span processor ל-PII redaction לפני export.
- Jaeger / Honeycomb ל-trace visualization.
- Prometheus + Grafana ל-metrics dashboard.
- ELK ל-structured logs.
- LangSmith / Phoenix ל-evals.
אות vs רעש
הטעות העיקרית - alert fatigue. מה לאלרט:
- Latency P99 > SLA - המשתמש מרגיש.
- Refusal rate spike - מודל / RAG הידרדרו.
- Cost spike - בוט בלולאה או DoS.
- Eval score drop - איכות התשובה ירדה.
מה לקחת מכאן
- Observability מהיום הראשון. לא "נוסיף אחר כך".
- OpenTelemetry GenAI conventions - תקן. אל תמציאו attributes משלכם.
- Evals offline + online. רק offline - לא תופסים regression. רק online - אין baseline.
- PII redaction לפני export. אחרת הטלמטריה הופכת attack surface.
קריאה נוספת
מה לקרוא הלאה