1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-01-26 03:52:03 +02:00

fix interceptor regexp

This commit is contained in:
Stefan Prisca 2020-04-30 16:39:30 +02:00
parent d7b3c3d7e7
commit c3e9bdb214

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)