(pkg string)
| 199 | } |
| 200 | |
| 201 | func funcFileLine(pkg string) (string, string, int) { |
| 202 | const depth = 16 |
| 203 | var pcs [depth]uintptr |
| 204 | n := runtime.Callers(3, pcs[:]) |
| 205 | ff := runtime.CallersFrames(pcs[:n]) |
| 206 | |
| 207 | var fn, file string |
| 208 | var line int |
| 209 | for { |
| 210 | f, ok := ff.Next() |
| 211 | if !ok { |
| 212 | break |
| 213 | } |
| 214 | fn, file, line = f.Function, f.File, f.Line |
| 215 | if !strings.Contains(fn, pkg) { |
| 216 | break |
| 217 | } |
| 218 | } |
| 219 | |
| 220 | if ind := strings.LastIndexByte(fn, '/'); ind != -1 { |
| 221 | fn = fn[ind+1:] |
| 222 | } |
| 223 | |
| 224 | return fn, file, line |
| 225 | } |
| 226 | |
| 227 | // Database span attributes semantic conventions recommended server address and port |
| 228 | // https://opentelemetry.io/docs/specs/semconv/database/database-spans/#connection-level-attributes |
no test coverage detected