@@ -61,8 +61,8 @@ final class SdkSpan implements ReadWriteSpan {
6161 private final InstrumentationScopeInfo instrumentationScopeInfo ;
6262 // The start time of the span.
6363 private final long startEpochNanos ;
64- // Callback to run when span ends.
65- private final Runnable onEnd ;
64+ // Callback to run when span ends to record metrics .
65+ private final Runnable recordEndMetrics ;
6666
6767 // Lock used to internally guard the mutable state of this instance
6868 private final Object lock = new Object ();
@@ -136,7 +136,7 @@ private SdkSpan(
136136 @ Nullable List <LinkData > links ,
137137 int totalRecordedLinks ,
138138 long startEpochNanos ,
139- Runnable onEnd ) {
139+ Runnable recordEndMetrics ) {
140140 this .context = context ;
141141 this .instrumentationScopeInfo = instrumentationScopeInfo ;
142142 this .parentSpanContext = parentSpanContext ;
@@ -152,7 +152,7 @@ private SdkSpan(
152152 this .startEpochNanos = startEpochNanos ;
153153 this .attributes = attributes ;
154154 this .spanLimits = spanLimits ;
155- this .onEnd = onEnd ;
155+ this .recordEndMetrics = recordEndMetrics ;
156156 }
157157
158158 /**
@@ -565,7 +565,7 @@ private void endInternal(long endEpochNanos) {
565565 spanEndingThread = Thread .currentThread ();
566566 hasEnded = EndState .ENDING ;
567567 }
568- onEnd .run ();
568+ recordEndMetrics .run ();
569569 if (spanProcessor instanceof ExtendedSpanProcessor ) {
570570 ExtendedSpanProcessor extendedSpanProcessor = (ExtendedSpanProcessor ) spanProcessor ;
571571 if (extendedSpanProcessor .isOnEndingRequired ()) {
0 commit comments