mirror of https://github.com/grpc/grpc-go.git
Merge 4f79357bfb
into 9ac0ec87ca
This commit is contained in:
commit
1100531e1a
|
@ -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{
|
||||
{
|
||||
|
@ -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,
|
||||
},
|
||||
|
@ -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{
|
||||
{
|
||||
|
@ -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,
|
||||
},
|
||||
|
@ -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{
|
||||
{
|
||||
|
@ -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,
|
||||
},
|
||||
|
@ -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),
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
@ -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.DelayedPickComplete:
|
||||
|
|
Loading…
Reference in New Issue