tracing updates #79

Merged
vtolstov merged 2 commits from updates into v3 2023-09-01 14:40:51 +03:00
4 changed files with 2089 additions and 2089 deletions
Showing only changes of commit 0e8e4d6e55 - Show all commits

16
gen.go
View File

@ -66,7 +66,7 @@ func main() {
continue
}
h := getHash(ifaces)
b.WriteString(fmt.Sprintf("\tif v, ok := dc.(wrapConn%04d_%s); ok {\n", n, h))
b.WriteString(fmt.Sprintf("\tif _, ok := dc.(wrapConn%04d_%s); ok {\n", n, h))
b.WriteString("\treturn struct {\n")
b.WriteString("\t\tdriver.Conn\n")
b.WriteString(fmt.Sprintf("\t\t\t%s", strings.Join(ifaces, "\n\t\t\t")))
@ -74,14 +74,14 @@ func main() {
for idx := range ifaces {
if idx > 0 {
b.WriteString(", ")
b.WriteString("v")
b.WriteString("c")
} else if idx == 0 {
b.WriteString("c")
} else {
b.WriteString("v")
b.WriteString("c")
}
}
b.WriteString(", v}\n")
b.WriteString(", c}\n")
b.WriteString("}\n\n")
}
b.WriteString("return c\n")
@ -112,7 +112,7 @@ func main() {
continue
}
h := getHash(ifaces)
b.WriteString(fmt.Sprintf("\tif v, ok := stmt.(wrapStmt%04d_%s); ok {\n", n, h))
b.WriteString(fmt.Sprintf("\tif _, ok := stmt.(wrapStmt%04d_%s); ok {\n", n, h))
b.WriteString("\treturn struct {\n")
b.WriteString("\t\tdriver.Stmt\n")
b.WriteString(fmt.Sprintf("\t\t\t%s", strings.Join(ifaces, "\n\t\t\t")))
@ -120,14 +120,14 @@ func main() {
for idx := range ifaces {
if idx > 0 {
b.WriteString(", ")
b.WriteString("v")
b.WriteString("c")
} else if idx == 0 {
b.WriteString("c")
} else {
b.WriteString("v")
b.WriteString("c")
}
}
b.WriteString(", v}\n")
b.WriteString(", c}\n")
b.WriteString("}\n\n")
}
b.WriteString("return c\n")

2
go.mod
View File

@ -1,6 +1,6 @@
module go.unistack.org/micro-wrapper-sql/v3
go 1.19
go 1.20
require (
go.unistack.org/micro-wrapper-requestid/v3 v3.8.7

View File

@ -44,13 +44,13 @@ var (
meterRequestDurationSeconds = "request_duration_seconds"
labelUnknown = "unknown"
labelQuery = "query"
labelMethod = "method"
labelQuery = "db.statement"
labelMethod = "db.method"
labelStatus = "status"
labelSuccess = "success"
labelFailure = "failure"
labelHost = "db_host"
labelDatabase = "db_name"
labelHost = "db.host"
labelDatabase = "db.name"
)
// Options struct holds wrapper options

File diff suppressed because it is too large Load Diff