chore: Enable netty metrics based on env var (#36108)

This commit is contained in:
Nidhi 2024-09-04 12:28:47 +05:30 committed by Nidhi Nair
parent 4a8fb690ed
commit f68f325a53
3 changed files with 12 additions and 1 deletions

View File

@ -67,6 +67,9 @@ public class CommonConfig {
@Value("${appsmith.micrometer.tracing.detail.enabled:false}")
private boolean tracingDetail;
@Value("${appsmith.micrometer.metrics.detail.enabled:false}")
private boolean metricsDetail;
private List<String> allowedDomains;
private String mongoDBVersion;

View File

@ -1,15 +1,22 @@
package com.appsmith.server.configurations;
import lombok.RequiredArgsConstructor;
import org.springframework.boot.web.embedded.netty.NettyReactiveWebServerFactory;
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
import org.springframework.stereotype.Component;
import java.util.function.Function;
@RequiredArgsConstructor
@Component
public class ReactorNettyConfiguration implements WebServerFactoryCustomizer<NettyReactiveWebServerFactory> {
private final CommonConfig commonConfig;
@Override
public void customize(NettyReactiveWebServerFactory factory) {
factory.addServerCustomizers(httpServer -> httpServer.metrics(true, Function.identity()));
if (commonConfig.isMetricsDetail()) {
factory.addServerCustomizers(httpServer -> httpServer.metrics(true, Function.identity()));
}
}
}

View File

@ -123,6 +123,7 @@ appsmith.newrelic.micrometer.metrics.application.name=${APPSMITH_NEWRELIC_MICROM
spring.application.name=${OTEL_SERVICE_NAME:appsmith-anonymous}
appsmith.micrometer.metrics.enabled=${APPSMITH_MICROMETER_METRICS_ENABLED:false}
appsmith.micrometer.tracing.detail.enabled=${APPSMITH_ENABLE_TRACING_DETAIL:false}
appsmith.micrometer.metrics.detail.enabled=${APPSMITH_ENABLE_METRICS_DETAIL:false}
springdoc.api-docs.path=/v3/docs
springdoc.swagger-ui.path=/v3/swagger