Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.

Commit

Permalink
feat: added support for span kind (#228)
Browse files Browse the repository at this point in the history
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/2172df15-42fb-4ea2-9939-61316a413093/targets

- [ ] To automatically regenerate this PR, check this box.

PiperOrigin-RevId: 319788951
Source-Link: googleapis/googleapis@13d3b3a
  • Loading branch information
yoshi-automation committed Jul 8, 2020
1 parent 547dc1f commit 534f960
Show file tree
Hide file tree
Showing 12 changed files with 786 additions and 257 deletions.
Expand Up @@ -261,11 +261,11 @@ public static class Builder extends StubSettings.Builder<TraceServiceStubSetting
ImmutableMap.Builder<String, ImmutableSet<StatusCode.Code>> definitions =
ImmutableMap.builder();
definitions.put(
"idempotent",
"retry_policy_1_codes",
ImmutableSet.copyOf(
Lists.<StatusCode.Code>newArrayList(
StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED)));
definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
RETRYABLE_CODE_DEFINITIONS = definitions.build();
}

Expand All @@ -279,12 +279,14 @@ public static class Builder extends StubSettings.Builder<TraceServiceStubSetting
.setInitialRetryDelay(Duration.ofMillis(100L))
.setRetryDelayMultiplier(1.2)
.setMaxRetryDelay(Duration.ofMillis(1000L))
.setInitialRpcTimeout(Duration.ofMillis(20000L))
.setRpcTimeoutMultiplier(1.5)
.setMaxRpcTimeout(Duration.ofMillis(30000L))
.setInitialRpcTimeout(Duration.ofMillis(45000L))
.setRpcTimeoutMultiplier(1.0)
.setMaxRpcTimeout(Duration.ofMillis(45000L))
.setTotalTimeout(Duration.ofMillis(45000L))
.build();
definitions.put("default", settings);
definitions.put("retry_policy_1_params", settings);
settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build();
definitions.put("no_retry_params", settings);
RETRY_PARAM_DEFINITIONS = definitions.build();
}

Expand Down Expand Up @@ -321,18 +323,18 @@ private static Builder initDefaults(Builder builder) {

builder
.patchTracesSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));

builder
.listTracesSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));

builder
.getTraceSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));

return builder;
}
Expand Down
Expand Up @@ -183,11 +183,13 @@ public static class Builder extends StubSettings.Builder<TraceServiceStubSetting
ImmutableMap.Builder<String, ImmutableSet<StatusCode.Code>> definitions =
ImmutableMap.builder();
definitions.put(
"idempotent",
"retry_policy_1_codes",
ImmutableSet.copyOf(
Lists.<StatusCode.Code>newArrayList(
StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED)));
definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
definitions.put(
"no_retry_1_codes", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
RETRYABLE_CODE_DEFINITIONS = definitions.build();
}

Expand All @@ -201,12 +203,22 @@ public static class Builder extends StubSettings.Builder<TraceServiceStubSetting
.setInitialRetryDelay(Duration.ofMillis(100L))
.setRetryDelayMultiplier(1.2)
.setMaxRetryDelay(Duration.ofMillis(1000L))
.setInitialRpcTimeout(Duration.ofMillis(30000L))
.setRpcTimeoutMultiplier(1.5)
.setMaxRpcTimeout(Duration.ofMillis(60000L))
.setInitialRpcTimeout(Duration.ofMillis(120000L))
.setRpcTimeoutMultiplier(1.0)
.setMaxRpcTimeout(Duration.ofMillis(120000L))
.setTotalTimeout(Duration.ofMillis(120000L))
.build();
definitions.put("retry_policy_1_params", settings);
settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build();
definitions.put("no_retry_params", settings);
settings =
RetrySettings.newBuilder()
.setInitialRpcTimeout(Duration.ofMillis(120000L))
.setRpcTimeoutMultiplier(1.0)
.setMaxRpcTimeout(Duration.ofMillis(120000L))
.setTotalTimeout(Duration.ofMillis(120000L))
.build();
definitions.put("default", settings);
definitions.put("no_retry_1_params", settings);
RETRY_PARAM_DEFINITIONS = definitions.build();
}

Expand Down Expand Up @@ -241,13 +253,13 @@ private static Builder initDefaults(Builder builder) {

builder
.createSpanSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));

builder
.batchWriteSpansSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));

return builder;
}
Expand Down
19 changes: 19 additions & 0 deletions proto-google-cloud-trace-v1/clirr-ignored-differences.xml
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- see http://www.mojohaus.org/clirr-maven-plugin/examples/ignored-differences.html -->
<differences>
<difference>
<differenceType>7012</differenceType>
<className>com/google/devtools/cloudtrace/v1/*OrBuilder</className>
<method>* get*(*)</method>
</difference>
<difference>
<differenceType>7012</differenceType>
<className>com/google/devtools/cloudtrace/v1/*OrBuilder</className>
<method>boolean contains*(*)</method>
</difference>
<difference>
<differenceType>7012</differenceType>
<className>com/google/devtools/cloudtrace/v1/*OrBuilder</className>
<method>boolean has*(*)</method>
</difference>
</differences>
Expand Up @@ -69,12 +69,12 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
static {
java.lang.String[] descriptorData = {
"\n)google/devtools/cloudtrace/v1/trace.pr"
+ "oto\022\035google.devtools.cloudtrace.v1\032\034goog"
+ "le/api/annotations.proto\032\027google/api/cli"
+ "ent.proto\032\037google/api/field_behavior.pro"
+ "to\032\031google/api/resource.proto\032\033google/pr"
+ "otobuf/empty.proto\032\037google/protobuf/time"
+ "stamp.proto\"f\n\005Trace\022\022\n\nproject_id\030\001 \001(\t"
+ "oto\022\035google.devtools.cloudtrace.v1\032\027goog"
+ "le/api/client.proto\032\037google/api/field_be"
+ "havior.proto\032\031google/api/resource.proto\032"
+ "\033google/protobuf/empty.proto\032\037google/pro"
+ "tobuf/timestamp.proto\032\034google/api/annota"
+ "tions.proto\"f\n\005Trace\022\022\n\nproject_id\030\001 \001(\t"
+ "\022\020\n\010trace_id\030\002 \001(\t\0227\n\005spans\030\003 \003(\0132(.goog"
+ "le.devtools.cloudtrace.v1.TraceSpan\">\n\006T"
+ "races\0224\n\006traces\030\001 \003(\0132$.google.devtools."
Expand Down Expand Up @@ -134,12 +134,12 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
com.google.api.AnnotationsProto.getDescriptor(),
com.google.api.ClientProto.getDescriptor(),
com.google.api.FieldBehaviorProto.getDescriptor(),
com.google.api.ResourceProto.getDescriptor(),
com.google.protobuf.EmptyProto.getDescriptor(),
com.google.protobuf.TimestampProto.getDescriptor(),
com.google.api.AnnotationsProto.getDescriptor(),
});
internal_static_google_devtools_cloudtrace_v1_Trace_descriptor =
getDescriptor().getMessageTypes().get(0);
Expand Down Expand Up @@ -221,12 +221,12 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
registry.add(com.google.api.ClientProto.oauthScopes);
com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor(
descriptor, registry);
com.google.api.AnnotationsProto.getDescriptor();
com.google.api.ClientProto.getDescriptor();
com.google.api.FieldBehaviorProto.getDescriptor();
com.google.api.ResourceProto.getDescriptor();
com.google.protobuf.EmptyProto.getDescriptor();
com.google.protobuf.TimestampProto.getDescriptor();
com.google.api.AnnotationsProto.getDescriptor();
}

// @@protoc_insertion_point(outer_class_scope)
Expand Down
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC.
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -16,12 +16,12 @@ syntax = "proto3";

package google.devtools.cloudtrace.v1;

import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
import "google/api/annotations.proto";

option csharp_namespace = "Google.Cloud.Trace.V1";
option go_package = "google.golang.org/genproto/googleapis/devtools/cloudtrace/v1;cloudtrace";
Expand Down
19 changes: 19 additions & 0 deletions proto-google-cloud-trace-v2/clirr-ignored-differences.xml
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- see http://www.mojohaus.org/clirr-maven-plugin/examples/ignored-differences.html -->
<differences>
<difference>
<differenceType>7012</differenceType>
<className>com/google/devtools/cloudtrace/v2/*OrBuilder</className>
<method>* get*(*)</method>
</difference>
<difference>
<differenceType>7012</differenceType>
<className>com/google/devtools/cloudtrace/v2/*OrBuilder</className>
<method>boolean contains*(*)</method>
</difference>
<difference>
<differenceType>7012</differenceType>
<className>com/google/devtools/cloudtrace/v2/*OrBuilder</className>
<method>boolean has*(*)</method>
</difference>
</differences>

0 comments on commit 534f960

Please sign in to comment.