openzipkin / zipkin-aws

Reporters and collectors for use in Amazon's cloud
Apache License 2.0
69 stars 34 forks source link

AwsClientTracing: Null pointer exception thrown for AwsAsyncClientBuilders #121

Closed sdavids13 closed 5 years ago

sdavids13 commented 5 years ago

Stack trace includes:

Caused by: java.lang.NullPointerException: null
    at brave.instrumentation.aws.AwsClientTracing$TracingExecutorFactory.<init>(AwsClientTracing.java:69)
    at brave.instrumentation.aws.AwsClientTracing.build(AwsClientTracing.java:47)

This is because the getClientConfiguration() does not get initialized by default in the default builder (thus blows up when calling clientConfiguration.getMaxConnections() in TracingExecutorFactory), instead Amazon uses AwsSyncClientParams to provide defaults if any are missing right before they call the build method:

    @Override
    public final TypeToBuild build() {
        return configureMutableProperties(build(getSyncClientParams()));
    }

Temporary work-around: Have async builders include: .withClientConfiguration(new ClientConfigurationFactory().getConfig());

devinsba commented 5 years ago

Pushed out in 0.15.4 thanks for the report