Skip to content

Commit

Permalink
fix sql instrument with DBQueryContext (#168)
Browse files Browse the repository at this point in the history
  • Loading branch information
GlqEason authored Feb 20, 2024
1 parent 8573c6f commit 140c58d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Release Notes.
* Fix wrong tracing context when trace have been sampled.
* Fix enhance param error when there are multiple params.
* Fix lost trace when multi middleware `handlerFunc` in `gin` plugin.
* Fix DBQueryContext execute error in `sql` plugin.

#### Issues and PR
- All issues are [here](https://github.com/apache/skywalking/milestone/197?closed=1)
Expand Down
9 changes: 8 additions & 1 deletion plugins/sql/entry/span.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ func getInstanceInfo(caller interface{}) InstanceInfo {
if !ok || instance == nil {
return nil
}
info := instance.GetSkyWalkingDynamicField().(InstanceInfo)
df := instance.GetSkyWalkingDynamicField()
if df == nil {
return nil
}
info, ok := df.(InstanceInfo)
if !ok {
return nil
}
return info
}

0 comments on commit 140c58d

Please sign in to comment.