Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
e01ca06
feat(observability): add no-op implementation of tracing
diegomarquezp Jan 8, 2026
d3f61d1
chore: add otel tracing recorder
diegomarquezp Jan 8, 2026
cf98e86
chore: add javadocs
diegomarquezp Jan 8, 2026
523c301
chore: adjust tests and conform more closely to metrics counterpart.
diegomarquezp Jan 8, 2026
d9534bd
chore: expand imports in otel it
diegomarquezp Jan 8, 2026
196d591
Update gax-java/gax/src/main/java/com/google/api/gax/tracing/OpenTele…
diegomarquezp Jan 8, 2026
ea075d3
test: use tracer provider in ItOtelMetrics
diegomarquezp Jan 8, 2026
2997153
Merge branch 'observability/tracing-noop' of https://github.com/googl…
diegomarquezp Jan 8, 2026
2c26971
chore: format
diegomarquezp Jan 8, 2026
1a76c29
chore: generate libraries at Thu Jan 8 19:39:27 UTC 2026
cloud-java-bot Jan 8, 2026
8a0f855
chore: add dummy tracing metric
diegomarquezp Jan 9, 2026
dc3ed42
chore: refine tracing IT
diegomarquezp Jan 9, 2026
5287f82
feat: add composite api tracer
diegomarquezp Jan 9, 2026
ce2d85b
test: use global config for tracing
diegomarquezp Jan 9, 2026
d6341cc
chore: restore metrics it
diegomarquezp Jan 9, 2026
a9c70ab
chore: format
diegomarquezp Jan 12, 2026
69a7fa4
Merge branch 'observability/tracing-noop' of https://github.com/googl…
diegomarquezp Jan 12, 2026
a6716b4
chore: format ii
diegomarquezp Jan 12, 2026
99bfd5b
chore: generate libraries at Mon Jan 12 21:30:41 UTC 2026
cloud-java-bot Jan 12, 2026
7b5709b
Merge branch 'observability/tracing-noop' of https://github.com/googl…
diegomarquezp Jan 13, 2026
6259b86
fix: Create a single S2AChannelCredentials per application (#3989)
rmehta19 Jan 9, 2026
61c1671
feat: add org.json:json to third-party-dependencies pom (#4047)
chingor13 Jan 9, 2026
069bc77
build: Update macOS version in nightly workflow (#4048)
diegomarquezp Jan 12, 2026
f5f94d8
chore(deps): update upper bound dependencies file (#4052)
diegomarquezp Jan 12, 2026
64685b5
deps: update google.http-client.version to 2.0.3 (#4054)
diegomarquezp Jan 12, 2026
7869ed9
chore: update googleapis commit at Wed Dec 10 02:37:02 UTC 2025 (#4013)
cloud-java-bot Jan 12, 2026
5218acb
chore(main): release 2.65.0 (#4058)
release-please[bot] Jan 13, 2026
7686f7f
build: Skip clirr check for protobuf 4.x upgrade (#4061)
blakeli0 Jan 13, 2026
af882ca
docs: Update docs for GoogleCredentialsProvider#setScopesToApply (#4057)
blakeli0 Jan 13, 2026
7575f5c
chore(main): release 2.65.1-SNAPSHOT (#4060)
release-please[bot] Jan 13, 2026
7d98fcc
build: Skip clirr check for downstream libraries (#4062)
blakeli0 Jan 13, 2026
24f7fc5
chore: Update protobuf runtime version to 4.33.4 in downstream checks…
blakeli0 Jan 13, 2026
cee4ad5
chore(main): release 2.65.1 (#4063)
release-please[bot] Jan 13, 2026
7aa0ea5
chore: cleanup release-please config (#4002)
diegomarquezp Jan 15, 2026
7f90d28
chore: generate libraries at Thu Jan 8 19:39:27 UTC 2026
cloud-java-bot Jan 8, 2026
d0b2eb3
chore: simplify implementation (no C3)
diegomarquezp Jan 21, 2026
ce9df43
Merge remote-tracking branch 'origin/main' into observability/tracing…
diegomarquezp Jan 21, 2026
b063a8d
chore: generate libraries at Wed Jan 21 20:06:59 UTC 2026
cloud-java-bot Jan 21, 2026
5da1d58
Merge branch 'observability/tracing-noop' of https://github.com/googl…
diegomarquezp Jan 23, 2026
8ffb32a
chore: adapt units in gax
diegomarquezp Jan 23, 2026
e3b2cda
chore: new option artifact-name for generator
diegomarquezp Jan 23, 2026
92d56e7
chore: add artifact name property to ClientContext and StubSettings
diegomarquezp Jan 23, 2026
5082240
chore: modify TracingTracerFactory
diegomarquezp Jan 23, 2026
e8d98b0
chore: remove initialization in client context
diegomarquezp Jan 26, 2026
87a3f8c
Merge remote-tracking branch 'origin/main' into observability/tracing…
diegomarquezp Jan 26, 2026
20461c1
chore: configure tracer factory in client context
diegomarquezp Jan 26, 2026
40b74bd
chore: format
diegomarquezp Jan 26, 2026
d1967f7
chore: introduce span context
diegomarquezp Jan 26, 2026
f626d4b
chore: adjust compilation issues and format
diegomarquezp Jan 26, 2026
e9fe905
chore: add scope
diegomarquezp Jan 27, 2026
09d1539
test: adjust goldens for pubsub
diegomarquezp Jan 27, 2026
a240c29
chore: suppress resource closed warning
diegomarquezp Jan 27, 2026
2334254
feat: generate with artifact_name
diegomarquezp Jan 27, 2026
3b8b665
chore: reset to minimal changes
diegomarquezp Jan 28, 2026
974ea10
chore: reset client context and stub settings
diegomarquezp Jan 28, 2026
502ef29
chore: add tests
diegomarquezp Jan 28, 2026
9461fd1
chore: span name and attempt attributes
diegomarquezp Jan 28, 2026
d786485
chore: use operation and attempt specific names
diegomarquezp Jan 28, 2026
33f346f
test: fix operation span
diegomarquezp Jan 28, 2026
90fdcc5
chore: adapt failedEcho test
diegomarquezp Jan 28, 2026
990af89
chore: format
diegomarquezp Jan 28, 2026
5a11e8a
chore: fix tracing tests
diegomarquezp Jan 28, 2026
e42b2a0
chore: implement gcp.client.service
diegomarquezp Jan 29, 2026
bed4a65
chore: add gcp.client.language attribute
diegomarquezp Jan 29, 2026
17743d1
chore: generate libraries at Thu Jan 29 16:56:49 UTC 2026
cloud-java-bot Jan 29, 2026
1801667
Merge branch 'observability/tracing-noop-2' of https://github.com/goo…
diegomarquezp Jan 29, 2026
3dc0f7a
chore: introduce server.port
diegomarquezp Jan 29, 2026
bfd68be
chore: add error.type
diegomarquezp Jan 29, 2026
b501f2a
chore: add rpc.system
diegomarquezp Jan 29, 2026
421abc9
chore: add resend_count
diegomarquezp Jan 29, 2026
fc22be3
chore: add server.address
diegomarquezp Jan 29, 2026
7fc007c
chore: add repo parameter in generator
diegomarquezp Jan 29, 2026
ab19aab
chore: use gapic properties
diegomarquezp Jan 30, 2026
a9db790
chore: format
diegomarquezp Jan 30, 2026
d969089
feat: generate repo in properties file
diegomarquezp Jan 30, 2026
d59a108
test: confirm behavior of repo span attribute
diegomarquezp Jan 30, 2026
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 @@ -30,7 +30,7 @@ RUN cat /java-formatter-version
RUN V=$(cat /java-formatter-version) && curl -o "/google-java-format.jar" "https://maven-central.storage-download.googleapis.com/maven2/com/google/googlejavaformat/google-java-format/${V}/google-java-format-${V}-all-deps.jar"

# Compile and install packages
RUN mvn install -B -ntp -DskipTests -Dclirr.skip -Dcheckstyle.skip
RUN mvn install -B -ntp -T 1.5C -DskipTests -Dcheckstyle.skip -Dclirr.skip -Denforcer.skip -Dfmt.skip
RUN cp "/root/.m2/repository/com/google/api/gapic-generator-java/${DOCKER_GAPIC_GENERATOR_VERSION}/gapic-generator-java-${DOCKER_GAPIC_GENERATOR_VERSION}.jar" \
"./gapic-generator-java.jar"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ static GapicMetadata defaultGapicMetadata() {

public abstract Transport transport();

public abstract Optional<String> repo();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I decided to enforce this input.


public static Builder builder() {
return new AutoValue_GapicContext.Builder()
.setMixinServices(Collections.emptyList())
Expand Down Expand Up @@ -130,6 +132,8 @@ public Builder setHelperResourceNames(Set<ResourceName> helperResourceNames) {

public abstract Builder setTransport(Transport transport);

public abstract Builder setRepo(String repo);

abstract ImmutableMap<String, ResourceName> resourceNames();

abstract ImmutableMap<String, ResourceName> helperResourceNames();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ public static GapicContext parse(CodeGeneratorRequest request) {
Optional<GapicLanguageSettings> languageSettingsOpt =
GapicLanguageSettingsParser.parse(gapicYamlConfigPathOpt);
Optional<String> transportOpt = PluginArgumentParser.parseTransport(request);
Optional<String> repo = PluginArgumentParser.parseRepo(request);

boolean willGenerateMetadata = PluginArgumentParser.hasMetadataFlag(request);
boolean willGenerateNumericEnum = PluginArgumentParser.hasNumericEnumFlag(request);
Expand Down Expand Up @@ -253,6 +254,7 @@ public static GapicContext parse(CodeGeneratorRequest request) {
.setServiceYamlProto(serviceYamlProtoOpt.orElse(null))
.setTransport(transport)
.setRestNumericEnumsEnabled(willGenerateNumericEnum)
.setRepo(repo.orElse(null))
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class PluginArgumentParser {
@VisibleForTesting static final String KEY_NUMERIC_ENUM = "rest-numeric-enums";
@VisibleForTesting static final String KEY_SERVICE_YAML_CONFIG = "api-service-config";
@VisibleForTesting static final String KEY_TRANSPORT = "transport";
@VisibleForTesting static final String KEY_REPO = "repo";

private static final String JSON_FILE_ENDING = "grpc_service_config.json";
private static final String GAPIC_YAML_FILE_ENDING = "gapic.yaml";
Expand All @@ -53,6 +54,10 @@ static Optional<String> parseTransport(CodeGeneratorRequest request) {
return parseConfigArgument(request.getParameter(), KEY_TRANSPORT);
}

static Optional<String> parseRepo(CodeGeneratorRequest request) {
return parseConfigArgument(request.getParameter(), KEY_REPO);
}

static boolean hasMetadataFlag(CodeGeneratorRequest request) {
return hasFlag(request.getParameter(), KEY_METADATA);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ protected static CodeGeneratorResponse write(

writeMetadataFile(context, writePackageInfo(gapicPackageInfo, codeWriter, jos), jos);
writeReflectConfigFile(gapicPackageInfo.packageInfo().pakkage(), reflectConfigInfo, jos);
writeGapicPropertiesFile(context, jos);

jos.finish();
jos.flush();
Expand Down Expand Up @@ -212,6 +213,22 @@ private static void writeMetadataFile(GapicContext context, String path, JarOutp
}
}

@VisibleForTesting
static void writeGapicPropertiesFile(GapicContext context, JarOutputStream jos) {
context
.repo()
.ifPresent(
repo -> {
JarEntry jarEntry = new JarEntry("src/main/resources/gapic.properties");
try {
jos.putNextEntry(jarEntry);
jos.write(String.format("repo=%s\n", repo).getBytes(StandardCharsets.UTF_8));
} catch (IOException e) {
throw new GapicWriterException("Could not write repo file", e);
}
});
}

private static String getPath(String pakkage, String className) {
String path = pakkage.replaceAll("\\.", "/");
if (className.startsWith("Mock") || className.endsWith("Test")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import static com.google.api.generator.gapic.protoparser.PluginArgumentParser.KEY_METADATA;
import static com.google.api.generator.gapic.protoparser.PluginArgumentParser.KEY_NUMERIC_ENUM;
import static com.google.api.generator.gapic.protoparser.PluginArgumentParser.KEY_REPO;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
Expand Down Expand Up @@ -269,6 +270,21 @@ void hasFlag_flagFound() {
assertTrue(PluginArgumentParser.hasFlag(rawArgument, KEY_METADATA));
}

@Test
void parseRepo_onlyOnePresent() {
String repo = "googleapis/sdk-platform-java";
CodeGeneratorRequest request =
CodeGeneratorRequest.newBuilder().setParameter(createRepo(repo)).build();
assertEquals(repo, PluginArgumentParser.parseRepo(request).get());
}

@Test
void parseRepo_noneFound() {
CodeGeneratorRequest request =
CodeGeneratorRequest.newBuilder().setParameter("metadata").build();
assertFalse(PluginArgumentParser.parseRepo(request).isPresent());
}

private static String createGrpcServiceConfig(String path) {
return String.format("%s=%s", PluginArgumentParser.KEY_GRPC_SERVICE_CONFIG, path);
}
Expand All @@ -280,4 +296,8 @@ private static String createGapicConfig(String path) {
private static String createServiceConfig(String path) {
return String.format("%s=%s", PluginArgumentParser.KEY_SERVICE_YAML_CONFIG, path);
}

private static String createRepo(String repo) {
return String.format("%s=%s", KEY_REPO, repo);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.google.gson.Gson;
import com.google.protobuf.ByteString;
import com.google.protobuf.compiler.PluginProtos.CodeGeneratorResponse;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
Expand Down Expand Up @@ -144,4 +145,26 @@ void productionWrite_emptyGapicContext_succeeds() throws IOException {
"temp-codegen.srcjar");
assertNull(result);
}

@Test
void writeRepoFile_isWritten() throws IOException {
String repo = "googleapis/sdk-platform-java";
GapicContext context = GapicContext.EMPTY.toBuilder().setRepo(repo).build();
Writer.writeGapicPropertiesFile(context, jarOutputStream);

closeJarOutputStream();

try (JarFile jarFile = new JarFile(file)) {
Enumeration<JarEntry> entries = jarFile.entries();
assertThat(entries.hasMoreElements()).isTrue();
JarEntry entry = entries.nextElement();
assertThat(entries.hasMoreElements()).isFalse();
assertEquals("src/main/resources/gapic.properties", entry.getName());
try (BufferedReader reader =
new BufferedReader(new InputStreamReader(jarFile.getInputStream(entry)))) {
String line = reader.readLine();
assertEquals("repo=" + repo, line);
}
}
}
}
1 change: 1 addition & 0 deletions gax-java/dependencies.properties
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ maven.com_google_api_grpc_grpc_google_common_protos=com.google.api.grpc:grpc-goo
maven.com_google_auth_google_auth_library_oauth2_http=com.google.auth:google-auth-library-oauth2-http:1.42.1
maven.com_google_auth_google_auth_library_credentials=com.google.auth:google-auth-library-credentials:1.42.1
maven.io_opentelemetry_opentelemetry_api=io.opentelemetry:opentelemetry-api:1.47.0
maven.io_opentelemetry_opentelemetry_context=io.opentelemetry:opentelemetry-context:1.47.0
maven.io_opencensus_opencensus_api=io.opencensus:opencensus-api:0.31.1
maven.io_opencensus_opencensus_contrib_grpc_metrics=io.opencensus:opencensus-contrib-grpc-metrics:0.31.1
maven.io_opencensus_opencensus_contrib_http_util=io.opencensus:opencensus-contrib-http-util:0.31.1
Expand Down
1 change: 1 addition & 0 deletions gax-java/gax/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ _COMPILE_DEPS = [
"@com_google_errorprone_error_prone_annotations//jar",
"@com_google_guava_guava//jar",
"@io_opentelemetry_opentelemetry_api//jar",
"@io_opentelemetry_opentelemetry_context//jar",
"@io_opencensus_opencensus_api//jar",
"@io_opencensus_opencensus_contrib_http_util//jar",
"@io_grpc_grpc_java//context:context",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import com.google.api.gax.rpc.internal.QuotaProjectIdHidingCredentials;
import com.google.api.gax.tracing.ApiTracerFactory;
import com.google.api.gax.tracing.BaseApiTracerFactory;
import com.google.api.gax.tracing.OpenTelemetryTracingTracer;
import com.google.auth.ApiKeyCredentials;
import com.google.auth.CredentialTypeForMetrics;
import com.google.auth.Credentials;
Expand Down Expand Up @@ -270,6 +271,25 @@ public static ClientContext create(StubSettings settings) throws IOException {
backgroundResources.add(watchdog);
}

ApiTracerFactory tracerFactory = settings.getTracerFactory();
if (tracerFactory != null) {
String rpcSystem = "";
if ("grpc".equals(transportChannel.getTransportName())) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic would likely be better in the tracer factory constructor.

rpcSystem = "grpc";
} else if ("httpjson".equals(transportChannel.getTransportName())) {
rpcSystem = "http";
}

tracerFactory =
tracerFactory.withAttributes(
ImmutableMap.of(),
ImmutableMap.of(
OpenTelemetryTracingTracer.SERVER_ADDRESS_ATTRIBUTE, settings.getServerAddress(),
OpenTelemetryTracingTracer.SERVICE_NAME_ATTRIBUTE, settings.getServiceName(),
OpenTelemetryTracingTracer.PORT_ATTRIBUTE, String.valueOf(settings.getPort()),
OpenTelemetryTracingTracer.RPC_SYSTEM_ATTRIBUTE, rpcSystem));
}

return newBuilder()
.setBackgroundResources(backgroundResources.build())
.setExecutor(backgroundExecutor)
Expand All @@ -284,7 +304,7 @@ public static ClientContext create(StubSettings settings) throws IOException {
.setQuotaProjectId(settings.getQuotaProjectId())
.setStreamWatchdog(watchdog)
.setStreamWatchdogCheckIntervalDuration(settings.getStreamWatchdogCheckIntervalDuration())
.setTracerFactory(settings.getTracerFactory())
.setTracerFactory(tracerFactory)
.setEndpointContext(endpointContext)
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,13 @@ public final String getEndpoint() {
return stubSettings.getEndpoint();
}

/**
* @return the fully resolved port used by the client
*/
public final int getPort() {
return stubSettings.getPort();
}

public final String getQuotaProjectId() {
return stubSettings.getQuotaProjectId();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ public static EndpointContext getDefaultInstance() {

public abstract String resolvedEndpoint();

public abstract int resolvedPort();

public abstract String resolvedServerAddress();

public abstract Builder toBuilder();

public static Builder newBuilder() {
Expand Down Expand Up @@ -228,6 +232,10 @@ public abstract static class Builder {

public abstract Builder setResolvedEndpoint(String resolvedEndpoint);

public abstract Builder setResolvedPort(int resolvedPort);

public abstract Builder setResolvedServerAddress(String resolvedServerAddress);

public abstract Builder setResolvedUniverseDomain(String resolvedUniverseDomain);

abstract Builder setUseS2A(boolean useS2A);
Expand Down Expand Up @@ -413,10 +421,37 @@ String mtlsEndpointResolver(
return endpoint;
}

private String parseServerAddress(String endpoint) {
int colonPortIndex = endpoint.lastIndexOf(':');
int doubleSlashIndex = endpoint.lastIndexOf("//");
if (colonPortIndex == -1) {
return endpoint;
}
if (doubleSlashIndex != -1 && doubleSlashIndex < colonPortIndex) {
return endpoint.substring(doubleSlashIndex + 2, colonPortIndex);
}
return endpoint.substring(0, colonPortIndex);
}

private int parsePort(String endpoint) {
int colonIndex = endpoint.lastIndexOf(':');
if (colonIndex != -1) {
try {
return Integer.parseInt(endpoint.substring(colonIndex + 1));
} catch (NumberFormatException e) {
// Fallback to default if parsing fails
}
}
return 443;
}

public EndpointContext build() throws IOException {
// The Universe Domain is used to resolve the Endpoint. It should be resolved first
setResolvedUniverseDomain(determineUniverseDomain());
setResolvedEndpoint(determineEndpoint());
String endpoint = determineEndpoint();
setResolvedEndpoint(endpoint);
setResolvedServerAddress(parseServerAddress(endpoint));
setResolvedPort(parsePort(endpoint));
setUseS2A(shouldUseS2A());
return autoBuild();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,20 @@ public String getEndpoint() {
return endpointContext.resolvedEndpoint();
}

/**
* @return the fully resolved port used by the client
*/
public final int getPort() {
return endpointContext.resolvedPort();
}

/**
* @return the fully resolved server address used by the client
*/
public final String getServerAddress() {
return endpointContext.resolvedServerAddress();
}

/**
* @return the newly created EndpointContext
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

import com.google.api.core.InternalApi;
import com.google.api.core.InternalExtensionOnly;
import java.util.Map;

/**
* A factory to create new instances of {@link ApiTracer}s.
Expand Down Expand Up @@ -61,4 +62,16 @@ enum OperationType {
* @param operationType the type of operation that the tracer will trace
*/
ApiTracer newTracer(ApiTracer parent, SpanName spanName, OperationType operationType);

/**
* Returns a new {@link ApiTracerFactory} that will add the given attributes to all tracers
* created by the factory.
*
* @param operationAttributes the operation attributes to add to all tracers
* @param attemptAttributes the attempt attributes to add to all tracers
*/
default ApiTracerFactory withAttributes(
Map<String, String> operationAttributes, Map<String, String> attemptAttributes) {
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,11 @@
import com.google.api.core.BetaApi;
import com.google.api.core.InternalApi;
import com.google.api.core.ObsoleteApi;
import com.google.api.gax.rpc.ApiException;
import com.google.api.gax.rpc.StatusCode;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Stopwatch;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.CancellationException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.annotation.Nullable;
Expand Down Expand Up @@ -218,24 +216,6 @@ public void attemptPermanentFailure(Throwable error) {
metricsRecorder.recordAttemptCount(1, attributes);
}

/** Function to extract the status of the error as a string */
@VisibleForTesting
static String extractStatus(@Nullable Throwable error) {
final String statusString;

if (error == null) {
return StatusCode.Code.OK.toString();
} else if (error instanceof CancellationException) {
statusString = StatusCode.Code.CANCELLED.toString();
} else if (error instanceof ApiException) {
statusString = ((ApiException) error).getStatusCode().getCode().toString();
} else {
statusString = StatusCode.Code.UNKNOWN.toString();
}

return statusString;
}

/**
* Add attributes that will be attached to all metrics. This is expected to be called by
* handwritten client teams to add additional attributes that are not supposed be collected by
Expand All @@ -260,4 +240,10 @@ public void addAttributes(Map<String, String> attributes) {
Map<String, String> getAttributes() {
return attributes;
}

/** Function to extract the status of the error as a string */
@VisibleForTesting
String extractStatus(@Nullable Throwable error) {
return TracerUtils.extractStatus(error);
}
}
Loading
Loading