dify/api/core/ops
GareArc 1e845b9bdd
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 01:52:13 -08:00
..
aliyun_trace feat(ops): set root span kind for AliyunTrace to enable service-level metrics aggregation (#30728) 2026-01-13 10:12:00 +08:00
arize_phoenix_trace fix(api): Populate Missing Attributes For Arize Phoenix Integration (#29526) 2025-12-15 11:15:18 +08:00
entities feat(telemetry): add prompt generation telemetry to Enterprise OTEL 2026-02-04 00:38:17 -08:00
langfuse_trace feat(enterprise): Add OTEL telemetry with slim traces, metrics, and structured logs 2026-02-02 15:50:43 -08:00
langsmith_trace feat(enterprise): Add OTEL telemetry with slim traces, metrics, and structured logs 2026-02-02 15:50:43 -08:00
mlflow_trace feat: MLflow tracing (#26093) 2025-11-22 13:53:58 +08:00
opik_trace remove .value (#26633) 2025-10-11 09:08:29 +08:00
tencent_trace revert: "fix(ops): add streaming metrics and LLM span for agent-chat traces" (#29469) 2025-12-11 12:53:37 +08:00
weave_trace Fix duration displayed for workflow steps on Weave dashboard (#28289) 2025-11-20 11:37:01 +08:00
__init__.py feat: add ops trace (#5483) 2024-06-26 17:33:29 +08:00
base_trace_instance.py Migrate SQLAlchemy from 1.x to 2.0 with automated and manual adjustments (#23224) 2025-09-02 10:30:19 +08:00
ops_trace_manager.py fix(telemetry): enable metrics and logs for standalone prompt generation 2026-02-04 01:52:13 -08:00
utils.py fix(ops): correct LangSmith dotted_order timestamp format (#30022) 2025-12-23 19:00:17 +08:00