- Fix memory leak.
- Add code's line-numbers in the logs.
This commit is contained in:
parent
83c77670ab
commit
dbe13a7ed1
|
@ -51,7 +51,11 @@ public class PrometheusController { // TODO: remove this with migration to Sprin
|
|||
public String getMetrics() {
|
||||
PrometheusMeterRegistry registry = new PrometheusMeterRegistry(PrometheusConfig.DEFAULT);
|
||||
new JvmThreadMetrics().bindTo(registry);
|
||||
new JvmGcMetrics().bindTo(registry);
|
||||
try (JvmGcMetrics jvmGcMetrics = new JvmGcMetrics() ) {
|
||||
jvmGcMetrics.bindTo(registry);
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("", e);
|
||||
}
|
||||
new JvmMemoryMetrics().bindTo(registry);
|
||||
new DiskSpaceMetrics(new File("/")).bindTo(registry);
|
||||
new ProcessorMetrics().bindTo(registry); // metrics related to the CPU stats
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<Configuration status="DEBUG">
|
||||
<Appenders>
|
||||
<Console name="LogToConsole" target="SYSTEM_OUT">
|
||||
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %highlight{%-5level} %logger{36} - %msg%n"/>
|
||||
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %highlight{%-5level} %logger{36}.%M\(@%line\) - %msg%n"/>
|
||||
</Console>
|
||||
</Appenders>
|
||||
<Loggers>
|
||||
|
|
Loading…
Reference in New Issue