Skip to content

Commit

Permalink
remove PulsarBrokerInterceptorOpenTelemetry
Browse files Browse the repository at this point in the history
  • Loading branch information
crossoverJie committed May 25, 2024
1 parent 1affc88 commit e4fd028
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 74 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@
import org.apache.pulsar.broker.stats.MetricsGenerator;
import org.apache.pulsar.broker.stats.OpenTelemetryConsumerStats;
import org.apache.pulsar.broker.stats.OpenTelemetryTopicStats;
import org.apache.pulsar.broker.stats.PulsarBrokerInterceptorOpenTelemetry;
import org.apache.pulsar.broker.stats.PulsarBrokerOpenTelemetry;
import org.apache.pulsar.broker.stats.prometheus.PrometheusMetricsServlet;
import org.apache.pulsar.broker.stats.prometheus.PrometheusRawMetricsProvider;
Expand Down Expand Up @@ -255,7 +254,6 @@ public class PulsarService implements AutoCloseable, ShutdownService {

private MetricsGenerator metricsGenerator;
private final PulsarBrokerOpenTelemetry openTelemetry;
private PulsarBrokerInterceptorOpenTelemetry interceptorOpenTelemetry;
private OpenTelemetryTopicStats openTelemetryTopicStats;
private OpenTelemetryConsumerStats openTelemetryConsumerStats;

Expand Down Expand Up @@ -329,8 +327,6 @@ public PulsarService(ServiceConfiguration config,
this.config = config;

this.openTelemetry = new PulsarBrokerOpenTelemetry(config, openTelemetrySdkBuilderCustomizer);
this.interceptorOpenTelemetry = new PulsarBrokerInterceptorOpenTelemetry(config,
openTelemetrySdkBuilderCustomizer);

// validate `advertisedAddress`, `advertisedListeners`, `internalListenerName`
this.advertisedListeners = MultipleListenerValidator.validateAndAnalysisAdvertisedListener(config);
Expand Down Expand Up @@ -496,9 +492,6 @@ public CompletableFuture<Void> closeAsync() {
if (openTelemetry != null) {
openTelemetry.close();
}
if (interceptorOpenTelemetry != null) {
interceptorOpenTelemetry.close();
}

if (this.compactionServiceFactory != null) {
try {
Expand Down Expand Up @@ -851,7 +844,6 @@ public void start() throws PulsarServerException {
// use getter to support mocking getBrokerInterceptor method in tests
BrokerInterceptor interceptor = getBrokerInterceptor();
if (interceptor != null) {
this.interceptorOpenTelemetry.build();
brokerService.setInterceptor(interceptor);
interceptor.initialize(this);
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ public void txnEnded(String txnID, long txnAction) {

@Override
public void initialize(PulsarService pulsarService) throws Exception {
var meter = pulsarService.getInterceptorOpenTelemetry().getMeter();
var meter = pulsarService.getOpenTelemetry().getMeter();

messageCounter = meter
.counterBuilder(MESSAGE_COUNTER)
Expand Down

0 comments on commit e4fd028

Please sign in to comment.