Skip to content

Commit

Permalink
Merge pull request #954 from go-agent/8t-ga-ready
Browse files Browse the repository at this point in the history
Infinite tracing GA ready.
  • Loading branch information
purple4reina authored and GitHub Enterprise committed Jun 17, 2020
2 parents bcc6124 + 9315bfa commit 6dff733
Show file tree
Hide file tree
Showing 26 changed files with 1,062 additions and 367 deletions.
25 changes: 22 additions & 3 deletions v3/integrations/nrgrpc/nrgrpc_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"net"
"strings"
"testing"
"time"

"google.golang.org/grpc"
"google.golang.org/grpc/test/bufconn"
Expand All @@ -32,11 +31,11 @@ func newTestServerAndConn(t *testing.T, app *newrelic.Application) (*grpc.Server
s.Serve(lis)
}()

bufDialer := func(string, time.Duration) (net.Conn, error) {
bufDialer := func(context.Context, string) (net.Conn, error) {
return lis.Dial()
}
conn, err := grpc.Dial("bufnet",
grpc.WithDialer(bufDialer),
grpc.WithContextDialer(bufDialer),
grpc.WithInsecure(),
grpc.WithBlock(), // create the connection synchronously
grpc.WithUnaryInterceptor(UnaryClientInterceptor),
Expand Down Expand Up @@ -128,6 +127,11 @@ func TestUnaryServerInterceptor(t *testing.T) {
AgentAttributes: map[string]interface{}{
"httpResponseCode": 0,
"http.statusCode": 0,
"parent.account": "123",
"parent.app": "456",
"parent.transportDuration": internal.MatchAnything,
"parent.transportType": "HTTP",
"parent.type": "App",
"request.headers.contentType": "application/grpc",
"request.method": "TestApplication/DoUnaryUnary",
"request.uri": "grpc://bufnet/TestApplication/DoUnaryUnary",
Expand Down Expand Up @@ -300,6 +304,11 @@ func TestUnaryStreamServerInterceptor(t *testing.T) {
AgentAttributes: map[string]interface{}{
"httpResponseCode": 0,
"http.statusCode": 0,
"parent.account": "123",
"parent.app": "456",
"parent.transportDuration": internal.MatchAnything,
"parent.transportType": "HTTP",
"parent.type": "App",
"request.headers.contentType": "application/grpc",
"request.method": "TestApplication/DoUnaryStream",
"request.uri": "grpc://bufnet/TestApplication/DoUnaryStream",
Expand Down Expand Up @@ -399,6 +408,11 @@ func TestStreamUnaryServerInterceptor(t *testing.T) {
AgentAttributes: map[string]interface{}{
"httpResponseCode": 0,
"http.statusCode": 0,
"parent.account": "123",
"parent.app": "456",
"parent.transportDuration": internal.MatchAnything,
"parent.transportType": "HTTP",
"parent.type": "App",
"request.headers.contentType": "application/grpc",
"request.method": "TestApplication/DoStreamUnary",
"request.uri": "grpc://bufnet/TestApplication/DoStreamUnary",
Expand Down Expand Up @@ -511,6 +525,11 @@ func TestStreamStreamServerInterceptor(t *testing.T) {
AgentAttributes: map[string]interface{}{
"httpResponseCode": 0,
"http.statusCode": 0,
"parent.account": "123",
"parent.app": "456",
"parent.transportDuration": internal.MatchAnything,
"parent.transportType": "HTTP",
"parent.type": "App",
"request.headers.contentType": "application/grpc",
"request.method": "TestApplication/DoStreamStream",
"request.uri": "grpc://bufnet/TestApplication/DoStreamStream",
Expand Down
9 changes: 7 additions & 2 deletions v3/integrations/nrlambda/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,13 @@ func TestDistributedTracing(t *testing.T) {
},
UserAttributes: map[string]interface{}{},
AgentAttributes: map[string]interface{}{
"aws.lambda.coldStart": true,
"request.uri": "//:4000",
"aws.lambda.coldStart": true,
"parent.account": "1",
"parent.app": "1",
"parent.transportDuration": internal.MatchAnything,
"parent.transportType": "HTTPS",
"parent.type": "App",
"request.uri": "//:4000",
},
}})
if 0 == buf.Len() {
Expand Down
12 changes: 11 additions & 1 deletion v3/integrations/nrmicro/nrmicro_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,11 @@ func TestServerWrapperWithApp(t *testing.T) {
},
UserAttributes: map[string]interface{}{},
AgentAttributes: map[string]interface{}{
"parent.account": "123",
"parent.app": "456",
"parent.transportDuration": internal.MatchAnything,
"parent.transportType": "HTTP",
"parent.type": "App",
"request.method": "TestHandler.Method",
"request.uri": "micro://testing/TestHandler.Method",
"request.headers.accept": "application/json",
Expand Down Expand Up @@ -933,7 +938,12 @@ func TestServerSubscribe(t *testing.T) {
},
UserAttributes: map[string]interface{}{},
AgentAttributes: map[string]interface{}{
"message.routingKey": "topic",
"message.routingKey": "topic",
"parent.account": "123",
"parent.app": "456",
"parent.transportDuration": internal.MatchAnything,
"parent.transportType": "HTTP",
"parent.type": "App",
},
},
})
Expand Down
184 changes: 150 additions & 34 deletions v3/internal/com_newrelic_trace_v1/v1.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions v3/internal/com_newrelic_trace_v1/v1.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ service IngestService {
// Accepts a stream of Span messages, and returns an irregular stream of
// RecordStatus messages.
rpc RecordSpan(stream Span) returns (stream RecordStatus) {}

// Accepts a stream of SpanBatch messages, and returns an irregular
// stream of RecordStatus messages. This endpoint can be used to improve
// throughput when Span messages are small
rpc RecordSpanBatch(stream SpanBatch) returns (stream RecordStatus) {}
}

message SpanBatch {
repeated Span spans = 1;
}

message Span {
Expand Down
Loading

0 comments on commit 6dff733

Please sign in to comment.