mirror of
https://github.com/langgenius/dify.git
synced 2026-03-03 14:56:20 +08:00
feat(enterprise): Add OTEL logs export with span_id correlation
- Add ENTERPRISE_OTEL_LOGS_ENABLED and ENTERPRISE_OTLP_LOGS_ENDPOINT config options - Implement EnterpriseLoggingHandler for log record translation with trace/span ID parsing - Add LoggerProvider and BatchLogRecordProcessor for OTLP log export - Correlate telemetry logs with spans via span_id_source parameter - Attach log handler during enterprise telemetry initialization
This commit is contained in:
@ -37,6 +37,7 @@ def init_app(app: DifyApp) -> None:
|
||||
|
||||
_exporter = EnterpriseExporter(dify_config)
|
||||
atexit.register(_exporter.shutdown)
|
||||
_exporter.attach_log_handler()
|
||||
|
||||
# Import to trigger @signal.connect decorator registration
|
||||
import enterprise.telemetry.event_handlers # noqa: F401 # type: ignore[reportUnusedImport]
|
||||
|
||||
Reference in New Issue
Block a user