Search in sources :

Example 1 with SslOption

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

the class GrpcTransportConfig method read.

public void read(Properties properties) {
    ValueAnnotationProcessor reader = new ValueAnnotationProcessor();
    reader.process(this, properties);
    this.agentClientOption = readAgentClientOption(properties);
    // Metadata
    this.metadataClientOption = readMetadataClientOption(properties);
    // Stat
    this.statClientOption = readStatClientOption(properties);
    // Span
    this.spanClientOption = readSpanClientOption(properties);
    // Ssl
    SslOption sslOption = readSslOption(properties);
    this.sslOption = sslOption;
}
Also used : ValueAnnotationProcessor(com.navercorp.pinpoint.bootstrap.config.util.ValueAnnotationProcessor) SslOption(com.navercorp.pinpoint.grpc.client.config.SslOption)

Example 2 with SslOption

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

the class AgentGrpcDataSenderProvider method newChannelFactoryBuilder.

ChannelFactoryBuilder newChannelFactoryBuilder(boolean sslEnable) {
    final int channelExecutorQueueSize = grpcTransportConfig.getAgentChannelExecutorQueueSize();
    final UnaryCallDeadlineInterceptor unaryCallDeadlineInterceptor = new UnaryCallDeadlineInterceptor(grpcTransportConfig.getAgentRequestTimeout());
    final ClientOption clientOption = grpcTransportConfig.getAgentClientOption();
    ChannelFactoryBuilder channelFactoryBuilder = new DefaultChannelFactoryBuilder("AgentGrpcDataSender");
    channelFactoryBuilder.setHeaderFactory(headerFactory);
    channelFactoryBuilder.setNameResolverProvider(nameResolverProvider);
    channelFactoryBuilder.addClientInterceptor(unaryCallDeadlineInterceptor);
    if (clientInterceptorList != null) {
        for (ClientInterceptor clientInterceptor : clientInterceptorList) {
            logger.info("addClientInterceptor:{}", clientInterceptor);
            channelFactoryBuilder.addClientInterceptor(clientInterceptor);
        }
    }
    channelFactoryBuilder.setExecutorQueueSize(channelExecutorQueueSize);
    channelFactoryBuilder.setClientOption(clientOption);
    if (sslEnable) {
        SslOption sslOption = grpcTransportConfig.getSslOption();
        channelFactoryBuilder.setSslOption(sslOption);
    }
    return channelFactoryBuilder;
}
Also used : UnaryCallDeadlineInterceptor(com.navercorp.pinpoint.grpc.client.UnaryCallDeadlineInterceptor) SslOption(com.navercorp.pinpoint.grpc.client.config.SslOption) ClientInterceptor(io.grpc.ClientInterceptor) ClientOption(com.navercorp.pinpoint.grpc.client.config.ClientOption) ChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.ChannelFactoryBuilder) DefaultChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder) DefaultChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder)

Example 3 with SslOption

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

the class MetadataGrpcDataSenderProvider method newChannelFactoryBuilder.

protected ChannelFactoryBuilder newChannelFactoryBuilder(boolean sslEnable) {
    final int channelExecutorQueueSize = grpcTransportConfig.getMetadataChannelExecutorQueueSize();
    final UnaryCallDeadlineInterceptor unaryCallDeadlineInterceptor = new UnaryCallDeadlineInterceptor(grpcTransportConfig.getMetadataRequestTimeout());
    final ClientOption clientOption = grpcTransportConfig.getMetadataClientOption();
    ChannelFactoryBuilder channelFactoryBuilder = new DefaultChannelFactoryBuilder("MetadataGrpcDataSender");
    channelFactoryBuilder.setHeaderFactory(headerFactory);
    channelFactoryBuilder.setNameResolverProvider(nameResolverProvider);
    channelFactoryBuilder.addClientInterceptor(unaryCallDeadlineInterceptor);
    if (clientInterceptorList != null) {
        for (ClientInterceptor clientInterceptor : clientInterceptorList) {
            logger.info("addClientInterceptor:{}", clientInterceptor);
            channelFactoryBuilder.addClientInterceptor(clientInterceptor);
        }
    }
    channelFactoryBuilder.setExecutorQueueSize(channelExecutorQueueSize);
    channelFactoryBuilder.setClientOption(clientOption);
    if (sslEnable) {
        SslOption sslOption = grpcTransportConfig.getSslOption();
        channelFactoryBuilder.setSslOption(sslOption);
    }
    return channelFactoryBuilder;
}
Also used : UnaryCallDeadlineInterceptor(com.navercorp.pinpoint.grpc.client.UnaryCallDeadlineInterceptor) SslOption(com.navercorp.pinpoint.grpc.client.config.SslOption) ClientInterceptor(io.grpc.ClientInterceptor) ClientOption(com.navercorp.pinpoint.grpc.client.config.ClientOption) ChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.ChannelFactoryBuilder) DefaultChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder) DefaultChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder)

Example 4 with SslOption

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

the class StatGrpcDataSenderProvider method newChannelFactoryBuilder.

private ChannelFactoryBuilder newChannelFactoryBuilder(boolean sslEnable) {
    final int channelExecutorQueueSize = grpcTransportConfig.getStatChannelExecutorQueueSize();
    final UnaryCallDeadlineInterceptor unaryCallDeadlineInterceptor = new UnaryCallDeadlineInterceptor(grpcTransportConfig.getStatRequestTimeout());
    final ClientOption clientOption = grpcTransportConfig.getStatClientOption();
    ChannelFactoryBuilder channelFactoryBuilder = new DefaultChannelFactoryBuilder("StatGrpcDataSender");
    channelFactoryBuilder.setHeaderFactory(headerFactory);
    channelFactoryBuilder.setNameResolverProvider(nameResolverProvider);
    channelFactoryBuilder.addClientInterceptor(unaryCallDeadlineInterceptor);
    if (clientInterceptorList != null) {
        for (ClientInterceptor clientInterceptor : clientInterceptorList) {
            logger.info("addClientInterceptor:{}", clientInterceptor);
            channelFactoryBuilder.addClientInterceptor(clientInterceptor);
        }
    }
    channelFactoryBuilder.setExecutorQueueSize(channelExecutorQueueSize);
    channelFactoryBuilder.setClientOption(clientOption);
    if (sslEnable) {
        SslOption sslOption = grpcTransportConfig.getSslOption();
        channelFactoryBuilder.setSslOption(sslOption);
    }
    return channelFactoryBuilder;
}
Also used : UnaryCallDeadlineInterceptor(com.navercorp.pinpoint.grpc.client.UnaryCallDeadlineInterceptor) SslOption(com.navercorp.pinpoint.grpc.client.config.SslOption) ClientInterceptor(io.grpc.ClientInterceptor) ClientOption(com.navercorp.pinpoint.grpc.client.config.ClientOption) ChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.ChannelFactoryBuilder) DefaultChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder) DefaultChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder)

Example 5 with SslOption

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

the class GrpcTransportConfig method readSslOption.

public SslOption readSslOption(final Properties properties) {
    final String sslPrefix = "profiler.transport.grpc.ssl.";
    String agentRootPath = properties.getProperty(AgentDirectory.AGENT_ROOT_PATH_KEY);
    final SslOption.Builder builder = new SslOption.Builder(agentRootPath);
    ValueAnnotationProcessor reader = new ValueAnnotationProcessor();
    reader.process(builder, new PropertyPlaceholderHelper.PlaceholderResolver() {

        @Override
        public String resolvePlaceholder(String placeholderName) {
            String prefix = sslPrefix + placeholderName;
            return properties.getProperty(prefix);
        }
    });
    return builder.build();
}
Also used : PropertyPlaceholderHelper(com.navercorp.pinpoint.bootstrap.util.spring.PropertyPlaceholderHelper) ValueAnnotationProcessor(com.navercorp.pinpoint.bootstrap.config.util.ValueAnnotationProcessor) SslOption(com.navercorp.pinpoint.grpc.client.config.SslOption)

Aggregations

SslOption (com.navercorp.pinpoint.grpc.client.config.SslOption)6 ChannelFactoryBuilder (com.navercorp.pinpoint.grpc.client.ChannelFactoryBuilder)4 DefaultChannelFactoryBuilder (com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder)4 UnaryCallDeadlineInterceptor (com.navercorp.pinpoint.grpc.client.UnaryCallDeadlineInterceptor)4 ClientOption (com.navercorp.pinpoint.grpc.client.config.ClientOption)4 ClientInterceptor (io.grpc.ClientInterceptor)4 ValueAnnotationProcessor (com.navercorp.pinpoint.bootstrap.config.util.ValueAnnotationProcessor)2 PropertyPlaceholderHelper (com.navercorp.pinpoint.bootstrap.util.spring.PropertyPlaceholderHelper)1 DiscardClientInterceptor (com.navercorp.pinpoint.grpc.client.interceptor.DiscardClientInterceptor)1