@@ -116,7 +116,6 @@ private InfluxDbSender setupSender(@NotNull final InfluxDbConfiguration configur
116
116
117
117
final String host = configuration .getHost ();
118
118
final int port = configuration .getPort ();
119
- final String protocol = configuration .getProtocol ();
120
119
final String database = configuration .getDatabase ();
121
120
final String auth = configuration .getAuth ();
122
121
final int connectTimeout = configuration .getConnectTimeout ();
@@ -132,7 +131,7 @@ private InfluxDbSender setupSender(@NotNull final InfluxDbConfiguration configur
132
131
switch (configuration .getMode ()) {
133
132
case "http" :
134
133
log .info ("Creating InfluxDB HTTP sender for server {}:{} and database {}" , host , port , database );
135
- sender = new InfluxDbHttpSender (protocol , host , port , database , auth , TimeUnit .SECONDS , connectTimeout , connectTimeout , prefix );
134
+ sender = new InfluxDbHttpSender (configuration . getProtocolOrDefault ( "http" ) , host , port , database , auth , TimeUnit .SECONDS , connectTimeout , connectTimeout , prefix );
136
135
break ;
137
136
case "tcp" :
138
137
log .info ("Creating InfluxDB TCP sender for server {}:{} and database {}" , host , port , database );
@@ -146,7 +145,7 @@ private InfluxDbSender setupSender(@NotNull final InfluxDbConfiguration configur
146
145
log .info ("Creating InfluxDB Cloud sender for endpoint {}, bucket {}, organization {}" , host , bucket , organization );
147
146
checkNotNull (bucket , "Bucket name must be defined in cloud mode" );
148
147
checkNotNull (organization , "Organization must be defined in cloud mode" );
149
- sender = new InfluxDbCloudSender (protocol , host , port , auth , TimeUnit .SECONDS , connectTimeout , connectTimeout , prefix , organization , bucket );
148
+ sender = new InfluxDbCloudSender (configuration . getProtocolOrDefault ( "https" ) , host , port , auth , TimeUnit .SECONDS , connectTimeout , connectTimeout , prefix , organization , bucket );
150
149
break ;
151
150
152
151
}
0 commit comments