Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Use ServiceName + MethodName as the regex for Otel #2543

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,8 @@

/** Class with utility methods to create http/json-based direct callables. */
public class HttpJsonCallableFactory {
// Used to extract service and method name from a grpc MethodDescriptor.
// fullMethodName has the format: service.resource.action
// For example: compute.instances.addAccessConfig
private static final Pattern FULL_METHOD_NAME_REGEX = Pattern.compile("^(.+)\\.(.+)$");
// Used to extract service and method name from a HttpJson MethodDescriptor.
private static final Pattern FULL_METHOD_NAME_REGEX = Pattern.compile("^.*?([^./]+)/([^./]+)$");

private HttpJsonCallableFactory() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ public class HttpJsonCallableFactoryTest {
public void testGetSpanName() {
Map<String, SpanName> validNames =
ImmutableMap.of(
"compute.projects.disableXpnHost", SpanName.of("compute.projects", "disableXpnHost"),
"client.method", SpanName.of("client", "method"));
"google.cloud.service.v1.CoolService/CoolRPC", SpanName.of("CoolService", "CoolRPC"),
"CoolService/CoolRPC", SpanName.of("CoolService", "CoolRPC"));

for (Entry<String, SpanName> entry : validNames.entrySet()) {
@SuppressWarnings("unchecked")
Expand Down
Loading