Search in sources :

Example 11 with ChannelFactoryBuilder

use of com.navercorp.pinpoint.grpc.client.ChannelFactoryBuilder in project pinpoint by naver.

the class MetadataGrpcDataSenderProvider method get.

@Override
public EnhancedDataSender<MetaDataType> get() {
    final String collectorIp = grpcTransportConfig.getMetadataCollectorIp();
    final int collectorPort = grpcTransportConfig.getMetadataCollectorPort();
    final boolean sslEnable = grpcTransportConfig.isMetadataSslEnable();
    final int senderExecutorQueueSize = grpcTransportConfig.getMetadataSenderExecutorQueueSize();
    final ChannelFactoryBuilder channelFactoryBuilder = newChannelFactoryBuilder(sslEnable);
    final ChannelFactory channelFactory = channelFactoryBuilder.build();
    final int retryMaxCount = grpcTransportConfig.getMetadataRetryMaxCount();
    final int retryDelayMillis = grpcTransportConfig.getMetadataRetryDelayMillis();
    return new MetadataGrpcDataSender<>(collectorIp, collectorPort, senderExecutorQueueSize, messageConverter, channelFactory, retryMaxCount, retryDelayMillis);
}
Also used : MetadataGrpcDataSender(com.navercorp.pinpoint.profiler.sender.grpc.MetadataGrpcDataSender) ChannelFactory(com.navercorp.pinpoint.grpc.client.ChannelFactory) ChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.ChannelFactoryBuilder) DefaultChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder)

Example 12 with ChannelFactoryBuilder

use of com.navercorp.pinpoint.grpc.client.ChannelFactoryBuilder in project pinpoint by naver.

the class StatGrpcDataSenderProvider method get.

@Override
public DataSender<MetricType> get() {
    final String collectorIp = grpcTransportConfig.getStatCollectorIp();
    final int collectorPort = grpcTransportConfig.getStatCollectorPort();
    final boolean sslEnable = grpcTransportConfig.isStatSslEnable();
    final int senderExecutorQueueSize = grpcTransportConfig.getStatSenderExecutorQueueSize();
    final ChannelFactoryBuilder channelFactoryBuilder = newChannelFactoryBuilder(sslEnable);
    final ChannelFactory channelFactory = channelFactoryBuilder.build();
    // not singleton
    ReconnectExecutor reconnectExecutor = reconnectExecutorProvider.get();
    return new StatGrpcDataSender(collectorIp, collectorPort, senderExecutorQueueSize, messageConverter, reconnectExecutor, channelFactory);
}
Also used : StatGrpcDataSender(com.navercorp.pinpoint.profiler.sender.grpc.StatGrpcDataSender) ReconnectExecutor(com.navercorp.pinpoint.profiler.sender.grpc.ReconnectExecutor) ChannelFactory(com.navercorp.pinpoint.grpc.client.ChannelFactory) ChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.ChannelFactoryBuilder) DefaultChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder)

Aggregations

ChannelFactoryBuilder (com.navercorp.pinpoint.grpc.client.ChannelFactoryBuilder)12 DefaultChannelFactoryBuilder (com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder)12 ClientOption (com.navercorp.pinpoint.grpc.client.config.ClientOption)9 ChannelFactory (com.navercorp.pinpoint.grpc.client.ChannelFactory)6 UnaryCallDeadlineInterceptor (com.navercorp.pinpoint.grpc.client.UnaryCallDeadlineInterceptor)5 ClientInterceptor (io.grpc.ClientInterceptor)5 HeaderFactory (com.navercorp.pinpoint.grpc.client.HeaderFactory)4 SslOption (com.navercorp.pinpoint.grpc.client.config.SslOption)4 AgentHeaderFactory (com.navercorp.pinpoint.grpc.AgentHeaderFactory)3 ReconnectExecutor (com.navercorp.pinpoint.profiler.sender.grpc.ReconnectExecutor)3 GeneratedMessageV3 (com.google.protobuf.GeneratedMessageV3)2 DiscardClientInterceptor (com.navercorp.pinpoint.grpc.client.interceptor.DiscardClientInterceptor)2 MetaDataType (com.navercorp.pinpoint.profiler.metadata.MetaDataType)2 Empty (com.google.protobuf.Empty)1 PSpan (com.navercorp.pinpoint.grpc.trace.PSpan)1 PSpanMessage (com.navercorp.pinpoint.grpc.trace.PSpanMessage)1 SpanGrpc (com.navercorp.pinpoint.grpc.trace.SpanGrpc)1 GrpcMetadataMessageConverter (com.navercorp.pinpoint.profiler.context.grpc.GrpcMetadataMessageConverter)1 DnsExecutorServiceProvider (com.navercorp.pinpoint.profiler.context.provider.grpc.DnsExecutorServiceProvider)1 GrpcNameResolverProvider (com.navercorp.pinpoint.profiler.context.provider.grpc.GrpcNameResolverProvider)1