From c9c9290f5812b8cdbc4de98a4a53925ed8179a86 Mon Sep 17 00:00:00 2001 From: Anthony J Mirabella Date: Wed, 18 Jan 2023 17:03:12 -0500 Subject: [PATCH] Remove expensive calculation of gRPC message size Signed-off-by: Anthony J Mirabella --- CHANGELOG.md | 4 ++ .../grpc/otelgrpc/interceptor.go | 20 ++---- .../grpc/otelgrpc/test/grpc_test.go | 43 ------------- .../grpc/otelgrpc/test/interceptor_test.go | 62 +++++++------------ 4 files changed, 34 insertions(+), 95 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c17288ba94..62571fd6491 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - `otelmux`: Add new `WithSpanNameFormatter` option to `go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux` to allow customizing span names. (#3041) - Improve documentation for `samplers/jaegerremote` by providing examples of sampling endpoints. (#3147) +### Changed + +- `otelgrpc`: Remove expensive calculation of uncompressed message size attribute. (#TBD) + ## [1.12.0/0.37.0/0.6.0] ### Added diff --git a/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go b/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go index aeee1d18dbd..339e3d140ff 100644 --- a/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go +++ b/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go @@ -39,24 +39,16 @@ import ( type messageType attribute.KeyValue // Event adds an event of the messageType to the span associated with the -// passed context with id and size (if message is a proto message). -func (m messageType) Event(ctx context.Context, id int, message interface{}) { +// passed context with a message id. +func (m messageType) Event(ctx context.Context, id int, _ interface{}) { span := trace.SpanFromContext(ctx) if !span.IsRecording() { return } - if p, ok := message.(proto.Message); ok { - span.AddEvent("message", trace.WithAttributes( - attribute.KeyValue(m), - RPCMessageIDKey.Int(id), - RPCMessageUncompressedSizeKey.Int(proto.Size(p)), - )) - } else { - span.AddEvent("message", trace.WithAttributes( - attribute.KeyValue(m), - RPCMessageIDKey.Int(id), - )) - } + span.AddEvent("message", trace.WithAttributes( + attribute.KeyValue(m), + RPCMessageIDKey.Int(id), + )) } var ( diff --git a/instrumentation/google.golang.org/grpc/otelgrpc/test/grpc_test.go b/instrumentation/google.golang.org/grpc/otelgrpc/test/grpc_test.go index 9d5a87687d8..b6154ef5080 100644 --- a/instrumentation/google.golang.org/grpc/otelgrpc/test/grpc_test.go +++ b/instrumentation/google.golang.org/grpc/otelgrpc/test/grpc_test.go @@ -133,7 +133,6 @@ func checkUnaryClientSpans(t *testing.T, spans []trace.ReadOnlySpan) { Attributes: []attribute.KeyValue{ otelgrpc.RPCMessageIDKey.Int(1), otelgrpc.RPCMessageTypeKey.String("SENT"), - otelgrpc.RPCMessageUncompressedSizeKey.Int(0), }, }, { @@ -141,7 +140,6 @@ func checkUnaryClientSpans(t *testing.T, spans []trace.ReadOnlySpan) { Attributes: []attribute.KeyValue{ otelgrpc.RPCMessageIDKey.Int(1), otelgrpc.RPCMessageTypeKey.String("RECEIVED"), - otelgrpc.RPCMessageUncompressedSizeKey.Int(0), }, }, }, emptySpan.Events()) @@ -162,7 +160,6 @@ func checkUnaryClientSpans(t *testing.T, spans []trace.ReadOnlySpan) { otelgrpc.RPCMessageIDKey.Int(1), otelgrpc.RPCMessageTypeKey.String("SENT"), // largeReqSize from "google.golang.org/grpc/interop" + 12 (overhead). - otelgrpc.RPCMessageUncompressedSizeKey.Int(271840), }, }, { @@ -171,7 +168,6 @@ func checkUnaryClientSpans(t *testing.T, spans []trace.ReadOnlySpan) { otelgrpc.RPCMessageIDKey.Int(1), otelgrpc.RPCMessageTypeKey.String("RECEIVED"), // largeRespSize from "google.golang.org/grpc/interop" + 8 (overhead). - otelgrpc.RPCMessageUncompressedSizeKey.Int(314167), }, }, }, largeSpan.Events()) @@ -196,7 +192,6 @@ func checkStreamClientSpans(t *testing.T, spans []trace.ReadOnlySpan) { Attributes: []attribute.KeyValue{ otelgrpc.RPCMessageIDKey.Int(1), otelgrpc.RPCMessageTypeKey.String("SENT"), - otelgrpc.RPCMessageUncompressedSizeKey.Int(27190), }, }, { @@ -204,7 +199,6 @@ func checkStreamClientSpans(t *testing.T, spans []trace.ReadOnlySpan) { Attributes: []attribute.KeyValue{ otelgrpc.RPCMessageIDKey.Int(2), otelgrpc.RPCMessageTypeKey.String("SENT"), - otelgrpc.RPCMessageUncompressedSizeKey.Int(12), }, }, { @@ -212,7 +206,6 @@ func checkStreamClientSpans(t *testing.T, spans []trace.ReadOnlySpan) { Attributes: []attribute.KeyValue{ otelgrpc.RPCMessageIDKey.Int(3), otelgrpc.RPCMessageTypeKey.String("SENT"), - otelgrpc.RPCMessageUncompressedSizeKey.Int(1834), }, }, { @@ -220,7 +213,6 @@ func checkStreamClientSpans(t *testing.T, spans []trace.ReadOnlySpan) { Attributes: []attribute.KeyValue{ otelgrpc.RPCMessageIDKey.Int(4), otelgrpc.RPCMessageTypeKey.String("SENT"), - otelgrpc.RPCMessageUncompressedSizeKey.Int(45912), }, }, // client does not record an event for the server response. @@ -242,7 +234,6 @@ func checkStreamClientSpans(t *testing.T, spans []trace.ReadOnlySpan) { Attributes: []attribute.KeyValue{ otelgrpc.RPCMessageIDKey.Int(1), otelgrpc.RPCMessageTypeKey.String("SENT"), - otelgrpc.RPCMessageUncompressedSizeKey.Int(21), }, }, { @@ -250,7 +241,6 @@ func checkStreamClientSpans(t *testing.T, spans []trace.ReadOnlySpan) { Attributes: []attribute.KeyValue{ otelgrpc.RPCMessageIDKey.Int(1), otelgrpc.RPCMessageTypeKey.String("RECEIVED"), - otelgrpc.RPCMessageUncompressedSizeKey.Int(31423), }, }, { @@ -258,7 +248,6 @@ func checkStreamClientSpans(t *testing.T, spans []trace.ReadOnlySpan) { Attributes: []attribute.KeyValue{ otelgrpc.RPCMessageIDKey.Int(2), otelgrpc.RPCMessageTypeKey.String("RECEIVED"), - otelgrpc.RPCMessageUncompressedSizeKey.Int(13), }, }, { @@ -266,7 +255,6 @@ func checkStreamClientSpans(t *testing.T, spans []trace.ReadOnlySpan) { Attributes: []attribute.KeyValue{ otelgrpc.RPCMessageIDKey.Int(3), otelgrpc.RPCMessageTypeKey.String("RECEIVED"), - otelgrpc.RPCMessageUncompressedSizeKey.Int(2659), }, }, { @@ -274,7 +262,6 @@ func checkStreamClientSpans(t *testing.T, spans []trace.ReadOnlySpan) { Attributes: []attribute.KeyValue{ otelgrpc.RPCMessageIDKey.Int(4), otelgrpc.RPCMessageTypeKey.String("RECEIVED"), - otelgrpc.RPCMessageUncompressedSizeKey.Int(58987), }, }, }, streamOutput.Events()) @@ -294,7 +281,6 @@ func checkStreamClientSpans(t *testing.T, spans []trace.ReadOnlySpan) { Attributes: []attribute.KeyValue{ otelgrpc.RPCMessageIDKey.Int(1), otelgrpc.RPCMessageTypeKey.String("SENT"), - otelgrpc.RPCMessageUncompressedSizeKey.Int(27196), }, }, { @@ -302,7 +288,6 @@ func checkStreamClientSpans(t *testing.T, spans []trace.ReadOnlySpan) { Attributes: []attribute.KeyValue{ otelgrpc.RPCMessageIDKey.Int(1), otelgrpc.RPCMessageTypeKey.String("RECEIVED"), - otelgrpc.RPCMessageUncompressedSizeKey.Int(31423), }, }, { @@ -310,7 +295,6 @@ func checkStreamClientSpans(t *testing.T, spans []trace.ReadOnlySpan) { Attributes: []attribute.KeyValue{ otelgrpc.RPCMessageIDKey.Int(2), otelgrpc.RPCMessageTypeKey.String("SENT"), - otelgrpc.RPCMessageUncompressedSizeKey.Int(16), }, }, { @@ -318,7 +302,6 @@ func checkStreamClientSpans(t *testing.T, spans []trace.ReadOnlySpan) { Attributes: []attribute.KeyValue{ otelgrpc.RPCMessageIDKey.Int(2), otelgrpc.RPCMessageTypeKey.String("RECEIVED"), - otelgrpc.RPCMessageUncompressedSizeKey.Int(13), }, }, { @@ -326,7 +309,6 @@ func checkStreamClientSpans(t *testing.T, spans []trace.ReadOnlySpan) { Attributes: []attribute.KeyValue{ otelgrpc.RPCMessageIDKey.Int(3), otelgrpc.RPCMessageTypeKey.String("SENT"), - otelgrpc.RPCMessageUncompressedSizeKey.Int(1839), }, }, { @@ -334,7 +316,6 @@ func checkStreamClientSpans(t *testing.T, spans []trace.ReadOnlySpan) { Attributes: []attribute.KeyValue{ otelgrpc.RPCMessageIDKey.Int(3), otelgrpc.RPCMessageTypeKey.String("RECEIVED"), - otelgrpc.RPCMessageUncompressedSizeKey.Int(2659), }, }, { @@ -342,7 +323,6 @@ func checkStreamClientSpans(t *testing.T, spans []trace.ReadOnlySpan) { Attributes: []attribute.KeyValue{ otelgrpc.RPCMessageIDKey.Int(4), otelgrpc.RPCMessageTypeKey.String("SENT"), - otelgrpc.RPCMessageUncompressedSizeKey.Int(45918), }, }, { @@ -350,7 +330,6 @@ func checkStreamClientSpans(t *testing.T, spans []trace.ReadOnlySpan) { Attributes: []attribute.KeyValue{ otelgrpc.RPCMessageIDKey.Int(4), otelgrpc.RPCMessageTypeKey.String("RECEIVED"), - otelgrpc.RPCMessageUncompressedSizeKey.Int(58987), }, }, }, pingPong.Events()) @@ -375,7 +354,6 @@ func checkStreamServerSpans(t *testing.T, spans []trace.ReadOnlySpan) { Attributes: []attribute.KeyValue{ otelgrpc.RPCMessageIDKey.Int(1), otelgrpc.RPCMessageTypeKey.String("RECEIVED"), - otelgrpc.RPCMessageUncompressedSizeKey.Int(27190), }, }, { @@ -383,7 +361,6 @@ func checkStreamServerSpans(t *testing.T, spans []trace.ReadOnlySpan) { Attributes: []attribute.KeyValue{ otelgrpc.RPCMessageIDKey.Int(2), otelgrpc.RPCMessageTypeKey.String("RECEIVED"), - otelgrpc.RPCMessageUncompressedSizeKey.Int(12), }, }, { @@ -391,7 +368,6 @@ func checkStreamServerSpans(t *testing.T, spans []trace.ReadOnlySpan) { Attributes: []attribute.KeyValue{ otelgrpc.RPCMessageIDKey.Int(3), otelgrpc.RPCMessageTypeKey.String("RECEIVED"), - otelgrpc.RPCMessageUncompressedSizeKey.Int(1834), }, }, { @@ -399,7 +375,6 @@ func checkStreamServerSpans(t *testing.T, spans []trace.ReadOnlySpan) { Attributes: []attribute.KeyValue{ otelgrpc.RPCMessageIDKey.Int(4), otelgrpc.RPCMessageTypeKey.String("RECEIVED"), - otelgrpc.RPCMessageUncompressedSizeKey.Int(45912), }, }, { @@ -407,7 +382,6 @@ func checkStreamServerSpans(t *testing.T, spans []trace.ReadOnlySpan) { Attributes: []attribute.KeyValue{ otelgrpc.RPCMessageIDKey.Int(1), otelgrpc.RPCMessageTypeKey.String("SENT"), - otelgrpc.RPCMessageUncompressedSizeKey.Int(4), }, }, }, streamInput.Events()) @@ -428,7 +402,6 @@ func checkStreamServerSpans(t *testing.T, spans []trace.ReadOnlySpan) { Attributes: []attribute.KeyValue{ otelgrpc.RPCMessageIDKey.Int(1), otelgrpc.RPCMessageTypeKey.String("RECEIVED"), - otelgrpc.RPCMessageUncompressedSizeKey.Int(21), }, }, { @@ -436,7 +409,6 @@ func checkStreamServerSpans(t *testing.T, spans []trace.ReadOnlySpan) { Attributes: []attribute.KeyValue{ otelgrpc.RPCMessageIDKey.Int(1), otelgrpc.RPCMessageTypeKey.String("SENT"), - otelgrpc.RPCMessageUncompressedSizeKey.Int(31423), }, }, { @@ -444,7 +416,6 @@ func checkStreamServerSpans(t *testing.T, spans []trace.ReadOnlySpan) { Attributes: []attribute.KeyValue{ otelgrpc.RPCMessageIDKey.Int(2), otelgrpc.RPCMessageTypeKey.String("SENT"), - otelgrpc.RPCMessageUncompressedSizeKey.Int(13), }, }, { @@ -452,7 +423,6 @@ func checkStreamServerSpans(t *testing.T, spans []trace.ReadOnlySpan) { Attributes: []attribute.KeyValue{ otelgrpc.RPCMessageIDKey.Int(3), otelgrpc.RPCMessageTypeKey.String("SENT"), - otelgrpc.RPCMessageUncompressedSizeKey.Int(2659), }, }, { @@ -460,7 +430,6 @@ func checkStreamServerSpans(t *testing.T, spans []trace.ReadOnlySpan) { Attributes: []attribute.KeyValue{ otelgrpc.RPCMessageIDKey.Int(4), otelgrpc.RPCMessageTypeKey.String("SENT"), - otelgrpc.RPCMessageUncompressedSizeKey.Int(58987), }, }, }, streamOutput.Events()) @@ -480,7 +449,6 @@ func checkStreamServerSpans(t *testing.T, spans []trace.ReadOnlySpan) { Attributes: []attribute.KeyValue{ otelgrpc.RPCMessageIDKey.Int(1), otelgrpc.RPCMessageTypeKey.String("RECEIVED"), - otelgrpc.RPCMessageUncompressedSizeKey.Int(27196), }, }, { @@ -488,7 +456,6 @@ func checkStreamServerSpans(t *testing.T, spans []trace.ReadOnlySpan) { Attributes: []attribute.KeyValue{ otelgrpc.RPCMessageIDKey.Int(1), otelgrpc.RPCMessageTypeKey.String("SENT"), - otelgrpc.RPCMessageUncompressedSizeKey.Int(31423), }, }, { @@ -496,7 +463,6 @@ func checkStreamServerSpans(t *testing.T, spans []trace.ReadOnlySpan) { Attributes: []attribute.KeyValue{ otelgrpc.RPCMessageIDKey.Int(2), otelgrpc.RPCMessageTypeKey.String("RECEIVED"), - otelgrpc.RPCMessageUncompressedSizeKey.Int(16), }, }, { @@ -504,7 +470,6 @@ func checkStreamServerSpans(t *testing.T, spans []trace.ReadOnlySpan) { Attributes: []attribute.KeyValue{ otelgrpc.RPCMessageIDKey.Int(2), otelgrpc.RPCMessageTypeKey.String("SENT"), - otelgrpc.RPCMessageUncompressedSizeKey.Int(13), }, }, { @@ -512,7 +477,6 @@ func checkStreamServerSpans(t *testing.T, spans []trace.ReadOnlySpan) { Attributes: []attribute.KeyValue{ otelgrpc.RPCMessageIDKey.Int(3), otelgrpc.RPCMessageTypeKey.String("RECEIVED"), - otelgrpc.RPCMessageUncompressedSizeKey.Int(1839), }, }, { @@ -520,7 +484,6 @@ func checkStreamServerSpans(t *testing.T, spans []trace.ReadOnlySpan) { Attributes: []attribute.KeyValue{ otelgrpc.RPCMessageIDKey.Int(3), otelgrpc.RPCMessageTypeKey.String("SENT"), - otelgrpc.RPCMessageUncompressedSizeKey.Int(2659), }, }, { @@ -528,7 +491,6 @@ func checkStreamServerSpans(t *testing.T, spans []trace.ReadOnlySpan) { Attributes: []attribute.KeyValue{ otelgrpc.RPCMessageIDKey.Int(4), otelgrpc.RPCMessageTypeKey.String("RECEIVED"), - otelgrpc.RPCMessageUncompressedSizeKey.Int(45918), }, }, { @@ -536,7 +498,6 @@ func checkStreamServerSpans(t *testing.T, spans []trace.ReadOnlySpan) { Attributes: []attribute.KeyValue{ otelgrpc.RPCMessageIDKey.Int(4), otelgrpc.RPCMessageTypeKey.String("SENT"), - otelgrpc.RPCMessageUncompressedSizeKey.Int(58987), }, }, }, pingPong.Events()) @@ -560,7 +521,6 @@ func checkUnaryServerSpans(t *testing.T, spans []trace.ReadOnlySpan) { Attributes: []attribute.KeyValue{ otelgrpc.RPCMessageIDKey.Int(1), otelgrpc.RPCMessageTypeKey.String("RECEIVED"), - otelgrpc.RPCMessageUncompressedSizeKey.Int(0), }, }, { @@ -568,7 +528,6 @@ func checkUnaryServerSpans(t *testing.T, spans []trace.ReadOnlySpan) { Attributes: []attribute.KeyValue{ otelgrpc.RPCMessageIDKey.Int(1), otelgrpc.RPCMessageTypeKey.String("SENT"), - otelgrpc.RPCMessageUncompressedSizeKey.Int(0), }, }, }, emptySpan.Events()) @@ -589,7 +548,6 @@ func checkUnaryServerSpans(t *testing.T, spans []trace.ReadOnlySpan) { otelgrpc.RPCMessageIDKey.Int(1), otelgrpc.RPCMessageTypeKey.String("RECEIVED"), // largeReqSize from "google.golang.org/grpc/interop" + 12 (overhead). - otelgrpc.RPCMessageUncompressedSizeKey.Int(271840), }, }, { @@ -598,7 +556,6 @@ func checkUnaryServerSpans(t *testing.T, spans []trace.ReadOnlySpan) { otelgrpc.RPCMessageIDKey.Int(1), otelgrpc.RPCMessageTypeKey.String("SENT"), // largeRespSize from "google.golang.org/grpc/interop" + 8 (overhead). - otelgrpc.RPCMessageUncompressedSizeKey.Int(314167), }, }, }, largeSpan.Events()) diff --git a/instrumentation/google.golang.org/grpc/otelgrpc/test/interceptor_test.go b/instrumentation/google.golang.org/grpc/otelgrpc/test/interceptor_test.go index 89bf1beeaa0..ca03eb679b3 100644 --- a/instrumentation/google.golang.org/grpc/otelgrpc/test/interceptor_test.go +++ b/instrumentation/google.golang.org/grpc/otelgrpc/test/interceptor_test.go @@ -39,7 +39,6 @@ import ( "google.golang.org/grpc/interop/grpc_testing" "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" ) func getSpanFromRecorder(sr *tracetest.SpanRecorder, name string) (trace.ReadOnlySpan, bool) { @@ -102,14 +101,12 @@ func TestUnaryClientInterceptor(t *testing.T) { }, eventsAttr: []map[attribute.Key]attribute.Value{ { - otelgrpc.RPCMessageTypeKey: attribute.StringValue("SENT"), - otelgrpc.RPCMessageIDKey: attribute.IntValue(1), - otelgrpc.RPCMessageUncompressedSizeKey: attribute.IntValue(proto.Size(req)), + otelgrpc.RPCMessageTypeKey: attribute.StringValue("SENT"), + otelgrpc.RPCMessageIDKey: attribute.IntValue(1), }, { - otelgrpc.RPCMessageTypeKey: attribute.StringValue("RECEIVED"), - otelgrpc.RPCMessageIDKey: attribute.IntValue(1), - otelgrpc.RPCMessageUncompressedSizeKey: attribute.IntValue(proto.Size(reply)), + otelgrpc.RPCMessageTypeKey: attribute.StringValue("RECEIVED"), + otelgrpc.RPCMessageIDKey: attribute.IntValue(1), }, }, }, @@ -126,14 +123,12 @@ func TestUnaryClientInterceptor(t *testing.T) { }, eventsAttr: []map[attribute.Key]attribute.Value{ { - otelgrpc.RPCMessageTypeKey: attribute.StringValue("SENT"), - otelgrpc.RPCMessageIDKey: attribute.IntValue(1), - otelgrpc.RPCMessageUncompressedSizeKey: attribute.IntValue(proto.Size(req)), + otelgrpc.RPCMessageTypeKey: attribute.StringValue("SENT"), + otelgrpc.RPCMessageIDKey: attribute.IntValue(1), }, { - otelgrpc.RPCMessageTypeKey: attribute.StringValue("RECEIVED"), - otelgrpc.RPCMessageIDKey: attribute.IntValue(1), - otelgrpc.RPCMessageUncompressedSizeKey: attribute.IntValue(proto.Size(reply)), + otelgrpc.RPCMessageTypeKey: attribute.StringValue("RECEIVED"), + otelgrpc.RPCMessageIDKey: attribute.IntValue(1), }, }, }, @@ -150,14 +145,12 @@ func TestUnaryClientInterceptor(t *testing.T) { }, eventsAttr: []map[attribute.Key]attribute.Value{ { - otelgrpc.RPCMessageTypeKey: attribute.StringValue("SENT"), - otelgrpc.RPCMessageIDKey: attribute.IntValue(1), - otelgrpc.RPCMessageUncompressedSizeKey: attribute.IntValue(proto.Size(req)), + otelgrpc.RPCMessageTypeKey: attribute.StringValue("SENT"), + otelgrpc.RPCMessageIDKey: attribute.IntValue(1), }, { - otelgrpc.RPCMessageTypeKey: attribute.StringValue("RECEIVED"), - otelgrpc.RPCMessageIDKey: attribute.IntValue(1), - otelgrpc.RPCMessageUncompressedSizeKey: attribute.IntValue(proto.Size(reply)), + otelgrpc.RPCMessageTypeKey: attribute.StringValue("RECEIVED"), + otelgrpc.RPCMessageIDKey: attribute.IntValue(1), }, }, }, @@ -175,14 +168,12 @@ func TestUnaryClientInterceptor(t *testing.T) { }, eventsAttr: []map[attribute.Key]attribute.Value{ { - otelgrpc.RPCMessageTypeKey: attribute.StringValue("SENT"), - otelgrpc.RPCMessageIDKey: attribute.IntValue(1), - otelgrpc.RPCMessageUncompressedSizeKey: attribute.IntValue(proto.Size(req)), + otelgrpc.RPCMessageTypeKey: attribute.StringValue("SENT"), + otelgrpc.RPCMessageIDKey: attribute.IntValue(1), }, { - otelgrpc.RPCMessageTypeKey: attribute.StringValue("RECEIVED"), - otelgrpc.RPCMessageIDKey: attribute.IntValue(1), - otelgrpc.RPCMessageUncompressedSizeKey: attribute.IntValue(proto.Size(reply)), + otelgrpc.RPCMessageTypeKey: attribute.StringValue("RECEIVED"), + otelgrpc.RPCMessageIDKey: attribute.IntValue(1), }, }, expectErr: true, @@ -198,14 +189,12 @@ func TestUnaryClientInterceptor(t *testing.T) { }, eventsAttr: []map[attribute.Key]attribute.Value{ { - otelgrpc.RPCMessageTypeKey: attribute.StringValue("SENT"), - otelgrpc.RPCMessageIDKey: attribute.IntValue(1), - otelgrpc.RPCMessageUncompressedSizeKey: attribute.IntValue(proto.Size(req)), + otelgrpc.RPCMessageTypeKey: attribute.StringValue("SENT"), + otelgrpc.RPCMessageIDKey: attribute.IntValue(1), }, { - otelgrpc.RPCMessageTypeKey: attribute.StringValue("RECEIVED"), - otelgrpc.RPCMessageIDKey: attribute.IntValue(1), - otelgrpc.RPCMessageUncompressedSizeKey: attribute.IntValue(proto.Size(reply)), + otelgrpc.RPCMessageTypeKey: attribute.StringValue("RECEIVED"), + otelgrpc.RPCMessageIDKey: attribute.IntValue(1), }, }, }, @@ -222,14 +211,12 @@ func TestUnaryClientInterceptor(t *testing.T) { }, eventsAttr: []map[attribute.Key]attribute.Value{ { - otelgrpc.RPCMessageTypeKey: attribute.StringValue("SENT"), - otelgrpc.RPCMessageIDKey: attribute.IntValue(1), - otelgrpc.RPCMessageUncompressedSizeKey: attribute.IntValue(proto.Size(req)), + otelgrpc.RPCMessageTypeKey: attribute.StringValue("SENT"), + otelgrpc.RPCMessageIDKey: attribute.IntValue(1), }, { - otelgrpc.RPCMessageTypeKey: attribute.StringValue("RECEIVED"), - otelgrpc.RPCMessageIDKey: attribute.IntValue(1), - otelgrpc.RPCMessageUncompressedSizeKey: attribute.IntValue(proto.Size(reply)), + otelgrpc.RPCMessageTypeKey: attribute.StringValue("RECEIVED"), + otelgrpc.RPCMessageIDKey: attribute.IntValue(1), }, }, }, @@ -594,7 +581,6 @@ func TestServerInterceptorError(t *testing.T) { assert.ElementsMatch(t, []attribute.KeyValue{ attribute.Key("message.type").String("SENT"), attribute.Key("message.id").Int(1), - attribute.Key("message.uncompressed_size").Int(26), }, span.Events()[1].Attributes) }