rionmonster commented on code in PR #27576:
URL: https://github.com/apache/flink/pull/27576#discussion_r2800072208
##########
flink-metrics/flink-metrics-prometheus/src/main/java/org/apache/flink/metrics/prometheus/PrometheusPushGatewayReporterFactory.java:
##########
@@ -70,17 +72,28 @@ public PrometheusPushGatewayReporter
createMetricReporter(Properties properties)
jobName = configuredJobName + new AbstractID();
}
+ String username = metricConfig.getString(USERNAME.key(),
USERNAME.defaultValue());
+ String password = metricConfig.getString(PASSWORD.key(),
PASSWORD.defaultValue());
+
+ if ((username != null && password == null) || (username == null &&
password != null)) {
+ LOG.warn(
+ "Both username and password must be configured to enable
HTTP Basic Authentication. "
+ + "Currently only {} is configured, Basic Auth
will be disabled.",
+ username != null ? "username" : "password");
+ }
+
LOG.info(
- "Configured PrometheusPushGatewayReporter with {hostUrl:{},
jobName:{}, randomJobNameSuffix:{}, deleteOnShutdown:{}, groupingKey:{}}",
+ "Configured PrometheusPushGatewayReporter with {hostUrl:{},
jobName:{}, randomJobNameSuffix:{}, deleteOnShutdown:{}, groupingKey:{},
basicAuth:{}}",
hostUrl,
jobName,
randomSuffix,
deleteOnShutdown,
- groupingKey);
+ groupingKey,
+ username != null && password != null);
Review Comment:
Minor nit: this can probably align with the recently added
`basicAuthEnabled` flag to avoid the redundant logic.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]