Skip to content

Commit

Permalink
Remove unused monitoring frameworks (#884)
Browse files Browse the repository at this point in the history
* Removed BugSnag
* Removed Librato and Dropwizard dependencies
  • Loading branch information
andsel authored Dec 18, 2024
1 parent c9b4740 commit 5c1d8fb
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 224 deletions.
31 changes: 0 additions & 31 deletions broker/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@
<version>${netty.version}</version>
</dependency>


<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
Expand All @@ -107,7 +106,6 @@
<classifier>osx-x86_64</classifier>
</dependency>


<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
Expand Down Expand Up @@ -140,7 +138,6 @@
<scope>runtime</scope>
</dependency>


<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2-mvstore</artifactId>
Expand All @@ -153,34 +150,6 @@
<version>2.4.7</version>
</dependency>

<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-core</artifactId>
<version>3.2.2</version>
</dependency>
<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-jvm</artifactId>
<version>3.2.2</version>
</dependency>

<dependency>
<groupId>com.librato.metrics</groupId>
<artifactId>metrics-librato</artifactId>
<version>5.1.0</version>
</dependency>
<dependency>
<groupId>com.librato.metrics</groupId>
<artifactId>librato-java</artifactId>
<version>2.1.0</version>
</dependency>

<dependency>
<groupId>com.bugsnag</groupId>
<artifactId>bugsnag</artifactId>
<version>[3.0,4.0)</version>
</dependency>

<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
Expand Down
8 changes: 0 additions & 8 deletions broker/src/main/java/io/moquette/BrokerConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,9 @@ public final class BrokerConstants {
public static final int NO_BUFFER_FLUSH = -1;
public static final int IMMEDIATE_BUFFER_FLUSH = 0;

public static final String METRICS_ENABLE_PROPERTY_NAME = "use_metrics";
public static final String METRICS_LIBRATO_EMAIL_PROPERTY_NAME = "metrics.librato.email";
public static final String METRICS_LIBRATO_TOKEN_PROPERTY_NAME = "metrics.librato.token";
public static final String METRICS_LIBRATO_SOURCE_PROPERTY_NAME = "metrics.librato.source";

@Deprecated
public static final String ENABLE_TELEMETRY_NAME = IConfig.ENABLE_TELEMETRY_NAME;

public static final String BUGSNAG_ENABLE_PROPERTY_NAME = "use_bugsnag";
public static final String BUGSNAG_TOKEN_PROPERTY_NAME = "bugsnag.token";

@Deprecated
public static final String PERSISTENT_CLIENT_EXPIRATION_PROPERTY_NAME = IConfig.PERSISTENT_CLIENT_EXPIRATION_PROPERTY_NAME;

Expand Down
41 changes: 0 additions & 41 deletions broker/src/main/java/io/moquette/broker/BugSnagErrorsHandler.java

This file was deleted.

25 changes: 0 additions & 25 deletions broker/src/main/java/io/moquette/broker/NewNettyAcceptor.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ public void operationComplete(ChannelFuture future) throws Exception {
private final Map<String, Integer> ports = new HashMap<>();
private BytesMetricsCollector bytesMetricsCollector = new BytesMetricsCollector();
private MessageMetricsCollector metricsCollector = new MessageMetricsCollector();
private Optional<? extends ChannelInboundHandler> metrics;
private Optional<? extends ChannelInboundHandler> errorsCather;

private int nettySoBacklog;
private boolean nettySoReuseaddr;
Expand Down Expand Up @@ -173,23 +171,6 @@ public void initialize(NewNettyMQTTHandler mqttHandler, IConfig props, ISslConte
channelClass = NioServerSocketChannel.class;
}

final boolean useFineMetrics = props.boolProp(METRICS_ENABLE_PROPERTY_NAME, false);
if (useFineMetrics) {
DropWizardMetricsHandler metricsHandler = new DropWizardMetricsHandler();
metricsHandler.init(props);
this.metrics = Optional.of(metricsHandler);
} else {
this.metrics = Optional.empty();
}

final boolean useBugSnag = props.boolProp(BUGSNAG_ENABLE_PROPERTY_NAME, false);
if (useBugSnag) {
BugSnagErrorsHandler bugSnagHandler = new BugSnagErrorsHandler();
bugSnagHandler.init(props);
this.errorsCather = Optional.of(bugSnagHandler);
} else {
this.errorsCather = Optional.empty();
}
initializePlainTCPTransport(mqttHandler, props, brokerConfiguration);
initializeWebSocketTransport(mqttHandler, props, brokerConfiguration);
if (securityPortsConfigured(props)) {
Expand Down Expand Up @@ -287,9 +268,6 @@ private void configureMQTTPipeline(ChannelPipeline pipeline, MoquetteIdleTimeout
pipeline.addFirst("idleStateHandler", new IdleStateHandler(nettyChannelTimeoutSeconds, 0, 0));
pipeline.addAfter("idleStateHandler", "idleEventHandler", timeoutHandler);
// pipeline.addLast("logger", new LoggingHandler("Netty", LogLevel.ERROR));
if (errorsCather.isPresent()) {
pipeline.addLast("bugsnagCatcher", errorsCather.get());
}
pipeline.addFirst("bytemetrics", new BytesMetricsHandler(bytesMetricsCollector));
if (writeFlushMillis > IMMEDIATE_BUFFER_FLUSH) {
pipeline.addLast("autoflush", new AutoFlushHandler(writeFlushMillis, TimeUnit.MILLISECONDS));
Expand All @@ -298,9 +276,6 @@ private void configureMQTTPipeline(ChannelPipeline pipeline, MoquetteIdleTimeout
pipeline.addLast("encoder", MqttEncoder.INSTANCE);
pipeline.addLast("metrics", new MessageMetricsHandler(metricsCollector));
pipeline.addLast("messageLogger", new MQTTMessageLogger());
if (metrics.isPresent()) {
pipeline.addLast("wizardMetrics", metrics.get());
}
pipeline.addLast("handler", handler);
}

Expand Down

This file was deleted.

24 changes: 0 additions & 24 deletions distribution/src/main/resources/moquette.conf
Original file line number Diff line number Diff line change
Expand Up @@ -153,30 +153,6 @@ password_file config/password_file.conf
#*********************************************************************
# session_queue_size 1024

#*********************************************************************
# Metrics Configuration
#
# use_metrics: used to enable Dropwizard Metrics sampling metrics.
# metrics.librato.email: Librato account's email
# metrics.librato.token: Librato account's security token
# metrics.librato.source: your application as source in Librato
# definitions
#*********************************************************************
# use_metrics true
# metrics.librato.email [email protected]
# metrics.librato.token sdfergheghliuhyr2283ehd9827398h
# metrics.librato.source My Fantastic Service

#*********************************************************************
# Error Monitoring
#
# use_bugsnag: used to enable BugSnag error handler catcher.
# bugsnag.token: the token from your's bugsnag account
#*********************************************************************
# use_bugsnag false
# bugsnag.token wleifb8723784dbfeig74


#*********************************************************************
# Telemetry information sending
#
Expand Down

0 comments on commit 5c1d8fb

Please sign in to comment.