chihsuan commented on code in PR #10945:
URL: https://github.com/apache/ozone/pull/10945#discussion_r3743148251
##########
hadoop-ozone/httpfsgateway/src/main/java/org/apache/ozone/fs/http/server/HttpFSServerWebServer.java:
##########
@@ -129,6 +134,10 @@ public class HttpFSServerWebServer {
.setACL(new AccessControlList(conf.get(HTTP_ADMINS_KEY, " ")))
.addEndpoint(endpoint)
.build();
+
+ if (conf.getBoolean(HddsConfigKeys.HDDS_PROMETHEUS_ENABLED, true)) {
+ prometheusMetricsSink = BaseHttpServer.addPrometheusEndpoint(httpServer,
conf, NAME);
Review Comment:
I found that with `hdds.prometheus.endpoint.token` set, `httpfs` rejects the
bearer-token request that s3g accepts. Same token:
```
curl -H 'Authorization: Bearer testtoken' http://httpfs:14000/prom -> 401
curl -H 'Authorization: Bearer testtoken' http://s3g:19878/prom -> 200
```
Is this difference intentional, or should `HttpFS` be updated for
consistency?
##########
hadoop-ozone/httpfsgateway/src/main/java/org/apache/ozone/fs/http/server/HttpFSServerWebServer.java:
##########
@@ -161,6 +174,9 @@ public void join() throws InterruptedException {
public void stop() throws Exception {
httpServer.stop();
+ if (prometheusMetricsSink != null) {
+ DefaultMetricsSystem.instance().unregisterSource("prometheus");
Review Comment:
Would it make sense to omit this call? The Prometheus object is registered
as a `MetricsSink`, while `unregisterSource()` only removes metrics sources, so
it may not have any effect
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]