use of com.navercorp.pinpoint.grpc.server.HeaderPropagationInterceptor in project pinpoint by naver.
the class SpanServerTestMain method run.
public void run() throws Exception {
// InternalLoggerFactory.setDefaultFactory(Log4J2LoggerFactory.INSTANCE);
Logger logger = Logger.getLogger("io.grpc");
logger.setLevel(Level.FINER);
logger.addHandler(new ConsoleHandler());
GrpcReceiver grpcReceiver = new GrpcReceiver();
grpcReceiver.setBeanName("TraceServer");
BindAddress.Builder builder = BindAddress.newBuilder();
builder.setIp(IP);
builder.setPort(PORT);
grpcReceiver.setBindAddress(builder.build());
Executor executor = newWorkerExecutor(8);
ServerServiceDefinition bindableService = newSpanBindableService(executor);
grpcReceiver.setBindableServiceList(Collections.singletonList(bindableService));
grpcReceiver.setAddressFilter(new MockAddressFilter());
grpcReceiver.setExecutor(Executors.newFixedThreadPool(8));
grpcReceiver.setEnable(true);
grpcReceiver.setServerOption(ServerOption.newBuilder().build());
AgentHeaderReader agentHeaderReader = new AgentHeaderReader("test");
HeaderPropagationInterceptor interceptor = new HeaderPropagationInterceptor(agentHeaderReader);
grpcReceiver.setServerInterceptorList(Arrays.asList(interceptor));
// for(int i = 0; i < 9999; i++) {
grpcReceiver.afterPropertiesSet();
grpcReceiver.blockUntilShutdown();
// TimeUnit.SECONDS.sleep(30);
// System.out.println("###### SHUTDOWN");
// grpcReceiver.destroy();
// grpcReceiver.blockUntilShutdown();
// System.out.println("###### START");
// TimeUnit.SECONDS.sleep(30);
}
use of com.navercorp.pinpoint.grpc.server.HeaderPropagationInterceptor in project pinpoint by naver.
the class HeaderServerInterceptorFactory method newServerInterceptors.
private List<ServerInterceptor> newServerInterceptors(String name) {
HeaderReader<Header> headerReader = new AgentHeaderReader(name);
ServerInterceptor interceptor = new HeaderPropagationInterceptor(headerReader);
return Arrays.asList(interceptor);
}
Aggregations