|
15 | 15 | import kafka.server.KafkaConfig;
|
16 | 16 |
|
17 | 17 | import org.apache.kafka.common.config.ConfigDef;
|
| 18 | +import org.apache.kafka.common.config.types.Password; |
18 | 19 | import org.apache.kafka.common.utils.Utils;
|
19 | 20 |
|
20 | 21 | import com.automq.stream.s3.ByteBufAllocPolicy;
|
|
36 | 37 | import static org.apache.kafka.common.config.ConfigDef.Type.BOOLEAN;
|
37 | 38 | import static org.apache.kafka.common.config.ConfigDef.Type.INT;
|
38 | 39 | import static org.apache.kafka.common.config.ConfigDef.Type.LONG;
|
| 40 | +import static org.apache.kafka.common.config.ConfigDef.Type.PASSWORD; |
39 | 41 | import static org.apache.kafka.common.config.ConfigDef.Type.STRING;
|
40 | 42 |
|
41 | 43 | public class AutoMQConfig {
|
@@ -266,7 +268,7 @@ public static void define(ConfigDef configDef) {
|
266 | 268 | .define(AutoMQConfig.S3_NETWORK_REFILL_PERIOD_MS_CONFIG, INT, S3_REFILL_PERIOD_MS, MEDIUM, AutoMQConfig.S3_NETWORK_REFILL_PERIOD_MS_DOC)
|
267 | 269 | .define(AutoMQConfig.S3_TELEMETRY_METRICS_LEVEL_CONFIG, STRING, "INFO", MEDIUM, AutoMQConfig.S3_TELEMETRY_METRICS_LEVEL_DOC)
|
268 | 270 | .define(AutoMQConfig.S3_TELEMETRY_EXPORTER_REPORT_INTERVAL_MS_CONFIG, INT, S3_METRICS_EXPORTER_REPORT_INTERVAL_MS, MEDIUM, AutoMQConfig.S3_TELEMETRY_EXPORTER_REPORT_INTERVAL_MS_DOC)
|
269 |
| - .define(AutoMQConfig.S3_TELEMETRY_METRICS_EXPORTER_URI_CONFIG, STRING, null, HIGH, AutoMQConfig.S3_TELEMETRY_METRICS_EXPORTER_URI_DOC) |
| 271 | + .define(AutoMQConfig.S3_TELEMETRY_METRICS_EXPORTER_URI_CONFIG, PASSWORD, null, HIGH, AutoMQConfig.S3_TELEMETRY_METRICS_EXPORTER_URI_DOC) |
270 | 272 | .define(AutoMQConfig.S3_TELEMETRY_METRICS_BASE_LABELS_CONFIG, STRING, null, MEDIUM, AutoMQConfig.S3_TELEMETRY_METRICS_BASE_LABELS_DOC)
|
271 | 273 | .define(AutoMQConfig.S3_BACK_PRESSURE_ENABLED_CONFIG, BOOLEAN, AutoMQConfig.S3_BACK_PRESSURE_ENABLED_DEFAULT, MEDIUM, AutoMQConfig.S3_BACK_PRESSURE_ENABLED_DOC)
|
272 | 274 | .define(AutoMQConfig.S3_BACK_PRESSURE_COOLDOWN_MS_CONFIG, LONG, AutoMQConfig.S3_BACK_PRESSURE_COOLDOWN_MS_DEFAULT, MEDIUM, AutoMQConfig.S3_BACK_PRESSURE_COOLDOWN_MS_DOC)
|
@@ -367,7 +369,8 @@ private static String genWALConfig(KafkaConfig config) {
|
367 | 369 | }
|
368 | 370 |
|
369 | 371 | private static String genMetricsExporterURI(KafkaConfig config) {
|
370 |
| - String uri = config.getString(S3_TELEMETRY_METRICS_EXPORTER_URI_CONFIG); |
| 372 | + Password pwd = config.getPassword(S3_TELEMETRY_METRICS_EXPORTER_URI_CONFIG); |
| 373 | + String uri = pwd.value(); |
371 | 374 | if (uri == null) {
|
372 | 375 | uri = buildMetrixExporterURIWithOldConfigs(config);
|
373 | 376 | }
|
|
0 commit comments