Skip to content

Commit 92814d9

Browse files
obinnascale3obinnaokaforkarthikscale3
authored
Release 3.8.12 (#522)
* add instrumentation for neo4j * update version * update trace attributes version * update imports * add neo4j result span attributes * add neo4j result span attributes * bump bersion * fix db attributes error and add examples * handle result transformer * fix genai and pinecone instrumentations (#512) * fix genai and pinecone instrumentations * bump version * fix pinecone Index attribute --------- Co-authored-by: Obinna Okafor <[email protected]> * Improve Agno instrumentation (#513) * cast token count to int * bump version * only redirect stdout if logging is disabled * bump version * fix openai agents attribute error * bump version * fix openai responses api instrumentation (#519) Co-authored-by: Obinna Okafor <[email protected]> * fix JSON serializable error in neo4j (#521) Co-authored-by: Obinna Okafor <[email protected]> * fix merge conflict --------- Co-authored-by: Obinna Okafor <[email protected]> Co-authored-by: Karthik Kalyanaraman <[email protected]>
1 parent 2529ced commit 92814d9

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/langtrace_python_sdk/instrumentation/neo4j/patch.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@
3737

3838
def driver_patch(operation_name, version, tracer):
3939
def traced_method(wrapped, instance, args, kwargs):
40-
40+
try:
41+
query = args[0].text if hasattr(args[0], "text") else args[0]
42+
query_text = json.dumps(query)
43+
except (AttributeError, TypeError):
44+
query_text = args[0]
4145
api = APIS[operation_name]
4246
service_provider = SERVICE_PROVIDERS.get("NEO4J", "neo4j")
4347
extra_attributes = baggage.get_baggage(LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY)
@@ -49,7 +53,7 @@ def traced_method(wrapped, instance, args, kwargs):
4953
"langtrace.version": v(LANGTRACE_SDK_NAME),
5054
"db.system": "neo4j",
5155
"db.operation": api["OPERATION"],
52-
"db.query": json.dumps(args[0]) if args and len(args) > 0 else "",
56+
"db.query": query_text,
5357
**(extra_attributes if extra_attributes is not None else {}),
5458
}
5559

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "3.8.11"
1+
__version__ = "3.8.12"

0 commit comments

Comments
 (0)