Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ public final class HddsConfigKeys {
public static final String HDDS_PROMETHEUS_ENABLED =
"hdds.prometheus.endpoint.enabled";

public static final String HDDS_PROFILER_ENABLED =
"hdds.profiler.endpoint.enabled";

public static final String HDDS_KEY_LEN = "hdds.key.len";
public static final int HDDS_DEFAULT_KEY_LEN = 2048;
public static final String HDDS_KEY_ALGORITHM = "hdds.key.algo";
Expand Down
8 changes: 8 additions & 0 deletions hadoop-hdds/common/src/main/resources/ozone-default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,14 @@
</description>
</property>

<property>
<name>hdds.profiler.endpoint.enabled</name>
<value>false</value>
<tag>OZONE, MANAGEMENT</tag>
<description>Enable /prof java profiler servlet page on HTTP server.
</description>
</property>

<!--Ozone Settings-->
<property>
<name>ozone.administrators</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ public abstract class BaseHttpServer {

private boolean prometheusSupport;

private boolean profilerSupport;

public BaseHttpServer(Configuration conf, String name) throws IOException {
this.name = name;
this.conf = conf;
Expand Down Expand Up @@ -91,12 +93,22 @@ public BaseHttpServer(Configuration conf, String name) throws IOException {
prometheusSupport =
conf.getBoolean(HddsConfigKeys.HDDS_PROMETHEUS_ENABLED, false);

profilerSupport =
conf.getBoolean(HddsConfigKeys.HDDS_PROFILER_ENABLED, false);

if (prometheusSupport) {
prometheusMetricsSink = new PrometheusMetricsSink();
httpServer.getWebAppContext().getServletContext()
.setAttribute(PROMETHEUS_SINK, prometheusMetricsSink);
httpServer.addServlet("prometheus", "/prom", PrometheusServlet.class);
}

if (profilerSupport) {
LOG.warn(
"/prof java profiling servlet is activated. Not safe for "
+ "production!");
httpServer.addServlet("profile", "/prof", ProfileServlet.class);
}
}

}
Expand Down
Loading