dify/api/core
GareArc 8baffdb114
fix(telemetry): enable metrics and logs for standalone prompt generation
Remove app_id parameter from three endpoints and update trace manager to use
tenant_id as storage identifier when app_id is unavailable. This allows
standalone prompt generation utilities to emit telemetry.

Changes:
- controllers/console/app/generator.py: Remove app_id=None from 3 endpoints
  (RuleGenerateApi, RuleCodeGenerateApi, RuleStructuredOutputGenerateApi)
- core/ops/ops_trace_manager.py: Use tenant_id fallback in send_to_celery
  - Extract tenant_id from task.kwargs when app_id is None
  - Use 'tenant-{tenant_id}' format as storage identifier
  - Skip traces only if neither app_id nor tenant_id available

The trace metadata still contains the actual tenant_id, so enterprise
telemetry correctly emits metrics and logs grouped by tenant.
2026-02-04 02:01:46 -08:00
..
agent fix: missing content if assistant message with tool_calls (#30083) 2026-01-13 12:46:33 +08:00
app feat(enterprise): Add OTEL telemetry with slim traces, metrics, and structured logs 2026-02-02 15:50:43 -08:00
base feat: knowledge pipeline (#25360) 2025-09-18 12:49:10 +08:00
callback_handler Feat/support multimodal embedding (#29115) 2025-12-09 14:41:46 +08:00
datasource chore: use from __future__ import annotations (#30254) 2026-01-06 23:57:20 +09:00
db fix(db): parameterize sessionmaker with Session (#30612) 2026-01-06 15:23:50 +08:00
entities chore: use from __future__ import annotations (#30254) 2026-01-06 23:57:20 +09:00
errors chore: add ast-grep rule to convert Optional[T] to T | None (#25560) 2025-09-15 13:06:33 +08:00
extension change all to httpx (#26119) 2025-10-10 23:41:16 +08:00
external_data_tool chore: add ast-grep rule to convert Optional[T] to T | None (#25560) 2025-09-15 13:06:33 +08:00
file refactor: generate_url to support scenario to build url (#30598) 2026-01-06 14:53:38 +08:00
helper refactor: clean type: ignore comments in login.py and template_transformer.py (#30510) 2026-01-06 14:33:27 +08:00
llm_generator feat(telemetry): add prompt generation telemetry to Enterprise OTEL 2026-02-04 00:38:17 -08:00
logging feat(enterprise): Add OTEL telemetry with slim traces, metrics, and structured logs 2026-02-02 15:50:43 -08:00
mcp chore: use from __future__ import annotations (#30254) 2026-01-06 23:57:20 +09:00
memory refactor:Decouple Domain Models from Direct Database Access (#27316) 2025-10-28 09:59:30 +08:00
model_runtime fix: missing content if assistant message with tool_calls (#30083) 2026-01-13 12:46:33 +08:00
moderation fix(moderation): change OpenAI moderation model to omni-moderation-la… (#28119) 2025-11-13 15:21:44 +08:00
ops fix(telemetry): enable metrics and logs for standalone prompt generation 2026-02-04 02:01:46 -08:00
plugin chore: use from __future__ import annotations (#30254) 2026-01-06 23:57:20 +09:00
prompt Feat/support multimodal embedding (#29115) 2025-12-09 14:41:46 +08:00
rag chore: use from __future__ import annotations (#30254) 2026-01-06 23:57:20 +09:00
repositories rm type ignore (#25715) 2025-10-21 11:26:58 +08:00
schemas chore: use from __future__ import annotations (#30254) 2026-01-06 23:57:20 +09:00
tools feat(enterprise): Add OTEL telemetry with slim traces, metrics, and structured logs 2026-02-02 15:50:43 -08:00
trigger feat: add editing support for trigger subscriptions (#29957) 2025-12-24 19:15:54 +08:00
variables chore: use from __future__ import annotations (#30254) 2026-01-06 23:57:20 +09:00
workflow feat(telemetry): add input/output token split to enterprise OTEL traces 2026-02-03 19:27:11 -08:00
__init__.py Fix basedpyright type errors (#25435) 2025-09-10 01:54:26 +08:00
hosting_configuration.py feat: credit pool (#30720) 2026-01-08 13:17:30 +08:00
indexing_runner.py fix: handle missing `credential_id` (#30051) 2025-12-24 11:21:51 +08:00
model_manager.py Feat/support multimodal embedding (#29115) 2025-12-09 14:41:46 +08:00
provider_manager.py feat: credit pool (#30720) 2026-01-08 13:17:30 +08:00