Skip to content

Commit 140c58d

Browse files
authored
fix sql instrument with DBQueryContext (#168)
1 parent 8573c6f commit 140c58d

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

CHANGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Release Notes.
2525
* Fix wrong tracing context when trace have been sampled.
2626
* Fix enhance param error when there are multiple params.
2727
* Fix lost trace when multi middleware `handlerFunc` in `gin` plugin.
28+
* Fix DBQueryContext execute error in `sql` plugin.
2829

2930
#### Issues and PR
3031
- All issues are [here](https://github.com/apache/skywalking/milestone/197?closed=1)

plugins/sql/entry/span.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@ func getInstanceInfo(caller interface{}) InstanceInfo {
5454
if !ok || instance == nil {
5555
return nil
5656
}
57-
info := instance.GetSkyWalkingDynamicField().(InstanceInfo)
57+
df := instance.GetSkyWalkingDynamicField()
58+
if df == nil {
59+
return nil
60+
}
61+
info, ok := df.(InstanceInfo)
62+
if !ok {
63+
return nil
64+
}
5865
return info
5966
}

0 commit comments

Comments
 (0)