Kubesense gRPC Interceptor / Plugin

A plugin for use with the KubesenseSdk, used to track performance of gRPC and enable Kubesense Distributed Tracing.

Getting started

To utilize this plugin, create an instance of KubesenseGrpcInterceptor, then pass it to your generated gRPC client:

import 'package:kubesense_grpc_interceptor/kubesense_grpc_interceptor.dart'

// Initialize Kubesense, be sure to set the [KubesenseConfiguration.firstPartyHosts] member
// to enable Kubesense Distributed Tracing
final config = KubesenseConfiguration(
  // ...
  firstParthHosts = ['localhost']
)

// Create the gRPC channel
final channel = ClientChannel(
  'localhost',
  port: 50051,
  options: ChannelOptions(
    // ...
  ),
);

// Create the gRPC interceptor with the supported channel
final kubesenseInterceptor = KubesenseGrpcInterceptor(KubesenseSdk.instance, channel);

// Create the gRPC client, passing in the Kubesense interceptor
final stub = GreeterClient(channel, interceptors: [kubesenseInterceptor]);

Generating the test gRPC files

If you are working on tests for this package and need to regenerate the gRPC client and related code, follow the instructions on the gRPC Quick Start page.

The protobuf spec is held in test/protos/helloworld.proto

License

Apache License, v2.0