File tree Expand file tree Collapse file tree
netty/src/main/java/io/grpc/netty
opentelemetry/src/main/java/io/grpc/opentelemetry Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,6 +56,8 @@ final class TcpMetrics {
5656 } catch (Error e ) {
5757 log .log (Level .FINE , "Failed to load native Epoll library" , e );
5858 }
59+ log .log (Level .INFO , "Epoll available during static init of TcpMetrics:"
60+ + "{0}" , epollAvailable );
5961 DEFAULT_METRICS = new Metrics (epollAvailable );
6062 }
6163
@@ -198,8 +200,15 @@ void recordTcpInfo(Channel channel) {
198200 }
199201
200202 private void recordTcpInfo (Channel channel , boolean isClose ) {
201- if (epollSocketChannelClass == null
202- || !epollSocketChannelClass .isInstance (channel )) {
203+ if (epollSocketChannelClass == null ) {
204+ log .log (Level .FINE , "Skipping recordTcpInfo because"
205+ + "epollSocketChannelClass is null" );
206+ return ;
207+ }
208+ if (!epollSocketChannelClass .isInstance (channel )) {
209+ log .log (Level .FINE , "Skipping recordTcpInfo because channel is not an"
210+ + "instance of epollSocketChannelClass: {0}" , channel .getClass ()
211+ .getName ());
203212 return ;
204213 }
205214 List <String > labelValues = getLabelValues (channel );
Original file line number Diff line number Diff line change @@ -196,6 +196,7 @@ public void configureServerBuilder(ServerBuilder<?> serverBuilder) {
196196 serverBuilder .intercept (openTelemetryTracingModule .getServerSpanPropagationInterceptor ());
197197 }
198198 serverBuilder .addStreamTracerFactory (openTelemetryMetricsModule .getServerTracerFactory ());
199+ serverBuilder .addMetricSink (sink );
199200 }
200201
201202 @ VisibleForTesting
You can’t perform that action at this time.
0 commit comments