1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2024-12-12 10:04:29 +02:00

fix interceptor regexp

This commit is contained in:
Stefan Prisca 2020-04-30 16:39:30 +02:00
parent 34bd998963
commit 6ade533508

View File

@ -426,7 +426,7 @@ func peerInfoFromContext(ctx context.Context) []core.KeyValue {
return peerInfoFromTarget(p.Addr.String())
}
var fullMethodRegexp = regexp.MustCompile(`^/\S*\.(\S*)/\S*$`)
var fullMethodRegexp = regexp.MustCompile(`^/(?:\S*\.)?(\S*)/\S*$`)
func serviceFromFullMethod(method string) string {
match := fullMethodRegexp.FindAllStringSubmatch(method, 1)