contrib/google.golang.org/grpc

contrib/google.golang.org/grpc

Those integration are enabled by having the following import in the project’s orchestrion.tool.go file:

import (
	_ "github.com/DataDog/orchestrion"

	_ "gopkg.in/DataDog/dd-trace-go.v1/contrib/google.golang.org/grpc" // integration
	//...
)

The Go implementation of gRPC.

Client

Join Point
One of
Advice
Append the following grpc.DialOption arguments to the function call:
  1. // Using the following synthetic imports:
    import (
    	grpc "google.golang.org/grpc"
    	grpctrace "gopkg.in/DataDog/dd-trace-go.v1/contrib/google.golang.org/grpc"
    )
    grpc.WithChainStreamInterceptor(grpctrace.StreamClientInterceptor())
  2. // Using the following synthetic imports:
    import (
    	grpc "google.golang.org/grpc"
    	grpctrace "gopkg.in/DataDog/dd-trace-go.v1/contrib/google.golang.org/grpc"
    )
    grpc.WithChainUnaryInterceptor(grpctrace.UnaryClientInterceptor())

Server

Join Point
Advice
Append the following grpc.ServerOption arguments to the function call:
  1. // Using the following synthetic imports:
    import (
    	grpc "google.golang.org/grpc"
    	grpctrace "gopkg.in/DataDog/dd-trace-go.v1/contrib/google.golang.org/grpc"
    )
    grpc.ChainStreamInterceptor(grpctrace.StreamServerInterceptor())
  2. // Using the following synthetic imports:
    import (
    	grpc "google.golang.org/grpc"
    	grpctrace "gopkg.in/DataDog/dd-trace-go.v1/contrib/google.golang.org/grpc"
    )
    grpc.ChainUnaryInterceptor(grpctrace.UnaryServerInterceptor())