dify/api/controllers/console/app
GareArc c56e5a5b71
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-04 00:38:17 -08:00
..
__init__.py FEAT: NEW WORKFLOW ENGINE (#3160) 2024-04-08 18:51:46 +08:00
advanced_prompt_template.py refactor: port reqparse to Pydantic model (#28913) 2025-11-30 16:09:42 +09:00
agent.py refactor: port reqparse to Pydantic model (#28949) 2025-12-05 13:05:53 +09:00
annotation.py fix: csv injection in annotations export (#29462) 2025-12-15 17:14:05 +08:00
app.py refactor: port controllers/console/app/app.py (#30522) 2026-01-06 10:12:52 +08:00
app_import.py refactor: port reqparse to Pydantic model (#28949) 2025-12-05 13:05:53 +09:00
audio.py refactor: port reqparse to Pydantic model (#28949) 2025-12-05 13:05:53 +09:00
completion.py refactor: port reqparse to Pydantic model (#28913) 2025-11-30 16:09:42 +09:00
conversation.py fix(api): refactors the SQL LIKE pattern escaping logic to use a centralized utility function, ensuring consistent and secure handling of special characters across all database queries. (#30450) 2026-01-06 09:56:30 +08:00
conversation_variables.py refactor: port reqparse to Pydantic model (#28913) 2025-11-30 16:09:42 +09:00
error.py Restructure the File errors in controller (#23801) 2025-08-13 17:06:07 +08:00
generator.py feat(telemetry): add prompt generation telemetry to Enterprise OTEL 2026-02-04 00:38:17 -08:00
mcp_server.py refactor: port reqparse to Pydantic model (#28949) 2025-12-05 13:05:53 +09:00
message.py fix: admin dislike feedback lose content (#29327) 2025-12-09 16:07:59 +08:00
model_config.py api -> console_ns (#28246) 2025-11-24 10:04:11 +08:00
ops_trace.py refactor: port reqparse to Pydantic model (#28949) 2025-12-05 13:05:53 +09:00
site.py refactor: port reqparse to Pydantic model (#28949) 2025-12-05 13:05:53 +09:00
statistic.py refactor: port reqparse to Pydantic model (#28913) 2025-11-30 16:09:42 +09:00
workflow.py refactor: port reqparse to Pydantic model (#28913) 2025-11-30 16:09:42 +09:00
workflow_app_log.py refactor: port reqparse to Pydantic model (#28913) 2025-11-30 16:09:42 +09:00
workflow_draft_variable.py refactor: port reqparse to Pydantic model (#28949) 2025-12-05 13:05:53 +09:00
workflow_run.py refactor: port reqparse to Pydantic model (#28913) 2025-11-30 16:09:42 +09:00
workflow_statistic.py refactor: port reqparse to Pydantic model (#28913) 2025-11-30 16:09:42 +09:00
workflow_trigger.py fix: remove validate=True to fix flask-restx AttributeError (#29552) 2025-12-12 12:01:20 +08:00
wraps.py use deco to avoid current_user (#26077) 2025-10-16 15:45:51 +09:00