dify/api/core/ops/entities
GareArc 22c8d8d772
feat(telemetry): add prompt generation telemetry to Enterprise OTEL
- Add PromptGenerationTraceInfo trace entity with operation_type field
- Implement telemetry for rule-generate, code-generate, structured-output, instruction-modify operations
- Emit metrics: tokens (total/input/output), duration histogram, requests counter, errors counter
- Emit structured logs with model info and operation context
- Content redaction controlled by ENTERPRISE_INCLUDE_CONTENT env var
- Fix user_id propagation in TraceTask kwargs
- Fix latency calculation when llm_result is None

No spans exported - metrics and logs only for lightweight observability.
2026-02-05 20:14:49 -08:00
..
__init__.py feat: add ops trace (#5483) 2024-06-26 17:33:29 +08:00
config_entity.py feat: MLflow tracing (#26093) 2025-11-22 13:53:58 +08:00
trace_entity.py feat(telemetry): add prompt generation telemetry to Enterprise OTEL 2026-02-05 20:14:49 -08:00