Remove golang 'custom import path check' comments. It's a pure
accident (of the monkey see monkey do type) that we have them.
They reportedly break RPM package building for some otelttrpc
downstream consumers.
Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
Lift over the sample client/server code from otelgrpc,
gutting out any bits we don't support yet (streaming),
and adapting it for (otel)ttrpc.
Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
Borrow minimal example and instrumentation tests from PR#134.
Co-authored-by: Swagat Bora <sbora@amazon.com>
Co-authored-by: Krisztian Litkey <krisztian.litkey@intel.com>
Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
This commit adds a unary client and server interceptors
for opentelemetry tracing instrumentation. The interceptors
can be passed as ttrpc.ClientOpts and ttrpc.ServerOpt to
ttrpc during client and server creation with code like this:
client := ttrpc.NewClient(
conn,
ttrpc.UnaryClientInterceptor(
otelttrpc.UnaryClientInterceptor(),
),
)
and
server, err := ttrpc.NewServer(
ttrpc.WithUnaryServerInterceptor(
otelttrpc.UnaryServerInterceptor(),
),
)
These interceptors will then automatically handle generating
trace Spans for all called and served unary method calls. If
the rest of the code is properly set up to collect and export
tracing data to opentelemetry, these spans should show up as
part of the collected traces.
This code was written by lifting over the corresponding gRPC
instrumentation bits from the opentelemetry contrib go package,
leaving out bits considered unnecessary for an initial version,
then replacing gRPC-specific bits by corresponding ttRPC code.
The left out bits were intercepting filters as unnecessary and
the streaming interceptors as too complex for a first version.
Co-authored-by: Krisztian Litkey <krisztian.litkey@intel.com>
Co-authored-by: Swagat Bora <sbora@amazon.com>
Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>