Skip to content
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
50 changes: 0 additions & 50 deletions stats/opentelemetry/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -868,14 +868,6 @@ func (s) TestMetricsAndTracesOptionEnabled(t *testing.T) {
Key: "FailFast",
Value: attribute.BoolValue(false),
},
{
Key: "previous-rpc-attempts",
Value: attribute.IntValue(0),
},
{
Key: "transparent-retry",
Value: attribute.BoolValue(false),
},
},
events: []trace.Event{
{
Expand Down Expand Up @@ -990,14 +982,6 @@ func (s) TestMetricsAndTracesOptionEnabled(t *testing.T) {
Key: "FailFast",
Value: attribute.BoolValue(false),
},
{
Key: "previous-rpc-attempts",
Value: attribute.IntValue(0),
},
{
Key: "transparent-retry",
Value: attribute.BoolValue(false),
},
},
events: nil,
},
Expand Down Expand Up @@ -1092,14 +1076,6 @@ func (s) TestSpan(t *testing.T) {
Key: "FailFast",
Value: attribute.BoolValue(false),
},
{
Key: "previous-rpc-attempts",
Value: attribute.IntValue(0),
},
{
Key: "transparent-retry",
Value: attribute.BoolValue(false),
},
},
events: []trace.Event{
{
Expand Down Expand Up @@ -1198,14 +1174,6 @@ func (s) TestSpan(t *testing.T) {
Key: "FailFast",
Value: attribute.BoolValue(false),
},
{
Key: "previous-rpc-attempts",
Value: attribute.IntValue(0),
},
{
Key: "transparent-retry",
Value: attribute.BoolValue(false),
},
},
events: nil,
},
Expand Down Expand Up @@ -1302,14 +1270,6 @@ func (s) TestSpan_WithW3CContextPropagator(t *testing.T) {
Key: "FailFast",
Value: attribute.BoolValue(false),
},
{
Key: "previous-rpc-attempts",
Value: attribute.IntValue(0),
},
{
Key: "transparent-retry",
Value: attribute.BoolValue(false),
},
},
events: []trace.Event{
{
Expand Down Expand Up @@ -1408,14 +1368,6 @@ func (s) TestSpan_WithW3CContextPropagator(t *testing.T) {
Key: "FailFast",
Value: attribute.BoolValue(false),
},
{
Key: "previous-rpc-attempts",
Value: attribute.IntValue(0),
},
{
Key: "transparent-retry",
Value: attribute.BoolValue(false),
},
},
events: nil,
},
Expand Down Expand Up @@ -1766,8 +1718,6 @@ func (s) TestStreamingRPC_TraceSequenceNumbers(t *testing.T) {
attributes: []attribute.KeyValue{
attribute.Bool("Client", false),
attribute.Bool("FailFast", false),
attribute.Int("previous-rpc-attempts", 0),
attribute.Bool("transparent-retry", false),
},
},
{
Expand Down
13 changes: 9 additions & 4 deletions stats/opentelemetry/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,17 @@ func populateSpan(rs stats.RPCStats, ai *attemptInfo) {
// Note: Go always added Client and FailFast attributes even though they are not
// defined by the OpenCensus gRPC spec. Thus, they are unimportant for
// correctness.
span.SetAttributes(
attrs := []attribute.KeyValue{
attribute.Bool("Client", rs.Client),
attribute.Bool("FailFast", rs.FailFast),
attribute.Int64("previous-rpc-attempts", int64(ai.previousRPCAttempts)),
attribute.Bool("transparent-retry", rs.IsTransparentRetryAttempt),
)
}
if rs.Client {
attrs = append(attrs,
attribute.Int64("previous-rpc-attempts", int64(ai.previousRPCAttempts)),
attribute.Bool("transparent-retry", rs.IsTransparentRetryAttempt),
)
}
span.SetAttributes(attrs...)
// increment previous rpc attempts applicable for next attempt
atomic.AddUint32(&ai.previousRPCAttempts, 1)
case *stats.PickerUpdated:
Expand Down
Loading