File tree Expand file tree Collapse file tree 2 files changed +22
-3
lines changed
instrumentation-genai/opentelemetry-instrumentation-dify/src/opentelemetry/instrumentation/dify Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ def is_version_supported():
5050 except :
5151 return False
5252
53+
5354def is_wrapper_version_1 ():
5455 try :
5556 current_version = dify_config .CURRENT_VERSION
@@ -58,6 +59,14 @@ def is_wrapper_version_1():
5859 except :
5960 return False
6061
62+ def is_wrapper_version_1_for_plugin ():
63+ try :
64+ current_version = dify_config .CURRENT_VERSION
65+ return (_compare_versions (current_version , "0.8.3" ) >= 0
66+ and _compare_versions (current_version , "1.3.1" ) < 0 )
67+ except :
68+ return False
69+
6170def is_wrapper_version_2 ():
6271 try :
6372 current_version = dify_config .CURRENT_VERSION
@@ -66,4 +75,13 @@ def is_wrapper_version_2():
6675 except :
6776 return False
6877
78+ def is_wrapper_version_2_for_plugin ():
79+ try :
80+ current_version = dify_config .CURRENT_VERSION
81+ return (_compare_versions (current_version , "1.3.1" ) >= 0
82+ and _compare_versions (current_version , "1.4.3" ) <= 0 )
83+ except :
84+ return False
85+
86+
6987
Original file line number Diff line number Diff line change 77from opentelemetry .instrumentation .dify .handler ._rag_handler import ToolInvokeHandler , RetrieveHandler
88from opentelemetry .instrumentation .dify .handler ._rag_handler import VectorSearchHandler
99from opentelemetry .instrumentation .dify .handler ._rag_handler import FullTextSearchHandler
10- from opentelemetry .instrumentation .dify .config import is_wrapper_version_1 , is_wrapper_version_2
10+ from opentelemetry .instrumentation .dify .config import is_wrapper_version_1 , is_wrapper_version_2 , \
11+ is_wrapper_version_2_for_plugin , is_wrapper_version_1_for_plugin
1112
1213_WORKFLOW_NODE_MODULE = "core.workflow.nodes.base.node"
1314_RAG_RETRIEVAL_MODULE = "core.rag.retrieval.dataset_retrieval"
@@ -149,9 +150,9 @@ def set_workflow_cycle_wrapper_version_1(handler):
149150
150151
151152def set_plugin_wrapper (tracer ):
152- if is_wrapper_version_1 ():
153+ if is_wrapper_version_1_for_plugin ():
153154 set_plugin_wrapper_version_1 (tracer )
154- elif is_wrapper_version_2 ():
155+ elif is_wrapper_version_2_for_plugin ():
155156 set_plugin_wrapper_version_2 (tracer )
156157 else :
157158 return
You can’t perform that action at this time.
0 commit comments