mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: provisionerd tracing, add public trace ingestion (#4070)
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
package tracing
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func FuncName() string {
|
||||
fnpc, _, _, ok := runtime.Caller(1)
|
||||
if !ok {
|
||||
return ""
|
||||
}
|
||||
fn := runtime.FuncForPC(fnpc)
|
||||
name := fn.Name()
|
||||
if i := strings.LastIndex(name, "/"); i > 0 {
|
||||
name = name[i+1:]
|
||||
}
|
||||
return name
|
||||
}
|
||||
Reference in New Issue
Block a user