Skip to content

poc: Add ClientMetricsTracer to CompositeTracerFactory #1813

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

Closed
wants to merge 5 commits into from
Closed
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
2 changes: 2 additions & 0 deletions google-cloud-bigtable/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,12 @@
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax-grpc</artifactId>
<version>2.30.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax</artifactId>
<version>2.30.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,16 @@ public void attemptSucceeded() {
recordAttemptCompletion(null);
}

@Override
public void attemptSucceeded(Object response) {
attemptSucceeded();
}

@Override
public void operationSucceeded(Object response) {
operationSucceeded();
}

@Override
public void attemptCancelled() {
recordAttemptCompletion(new CancellationException());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,20 @@ public void operationSucceeded() {
}
}

@Override
public void operationSucceeded(Object response) {
for (ApiTracer child : children) {
child.operationSucceeded(response);
}
}

@Override
public void retryCount(int count) {
for (ApiTracer child : children) {
child.retryCount(count);
}
}

@Override
public void operationCancelled() {
for (ApiTracer child : children) {
Expand Down Expand Up @@ -110,6 +124,13 @@ public void attemptSucceeded() {
}
}

@Override
public void attemptSucceeded(Object response) {
for (ApiTracer child : children) {
child.attemptSucceeded(response);
}
}

@Override
public void attemptCancelled() {
for (ApiTracer child : children) {
Expand Down Expand Up @@ -225,4 +246,22 @@ public void grpcChannelQueuedLatencies(long queuedTimeMs) {
tracer.grpcChannelQueuedLatencies(queuedTimeMs);
}
}

@Override
public void grpcTargetResolutionDelay(long elapsed) {
for (ApiTracer child : children) {
child.grpcTargetResolutionDelay(elapsed);
} }

@Override
public void grpcChannelReadinessDelay(long elapsed) {
for (ApiTracer child : children) {
child.grpcChannelReadinessDelay(elapsed);
} }

@Override
public void grpcCallSendDelay(long elapsed) {
for (ApiTracer child : children) {
child.grpcCallSendDelay(elapsed);
} }
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.google.api.gax.tracing.ApiTracer;
import com.google.api.gax.tracing.ApiTracerFactory;
import com.google.api.gax.tracing.BaseApiTracerFactory;
import com.google.api.gax.tracing.ClientMetricsTracer;
import com.google.api.gax.tracing.SpanName;
import com.google.common.collect.ImmutableList;
import java.util.ArrayList;
Expand All @@ -42,4 +43,15 @@ public ApiTracer newTracer(ApiTracer parent, SpanName spanName, OperationType op
}
return new CompositeTracer(children);
}

@Override
public ClientMetricsTracer newClientMetricsTracer() {
for (ApiTracerFactory factory : apiTracerFactories) {
ClientMetricsTracer clientMetricsTracer = factory.newClientMetricsTracer();
if (clientMetricsTracer != null) {
return clientMetricsTracer;
}
}
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,16 @@ public void attemptSucceeded() {
recordAttemptCompletion(null);
}

@Override
public void attemptSucceeded(Object response) {
attemptSucceeded();
}

@Override
public void operationSucceeded(Object response) {
operationSucceeded();
}

@Override
public void attemptCancelled() {
recordAttemptCompletion(new CancellationException());
Expand Down