File tree Expand file tree Collapse file tree 5 files changed +15
-8
lines changed
dd-trace-core/src/main/java/datadog/trace/core
internal-api/src/main/java/datadog/trace/api/rum Expand file tree Collapse file tree 5 files changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -708,12 +708,13 @@ private CoreTracer(
708
708
: HealthMetrics .NO_OP ;
709
709
healthMetrics .start ();
710
710
711
+ // Start RUM injector health metrics
711
712
rumInjectorHealthMetrics =
712
713
config .isHealthMetricsEnabled () && config .isRumEnabled ()
713
714
? new DefaultRumInjectorHealthMetrics (this .statsDClient )
714
715
: RumInjectorHealthMetrics .NO_OP ;
715
716
rumInjectorHealthMetrics .start ();
716
- // Register health metrics telemetry collector with RumInjector
717
+ // Register rumInjectorHealthMetrics as the RumInjector's telemetry collector
717
718
RumInjector .setTelemetryCollector ((DefaultRumInjectorHealthMetrics ) rumInjectorHealthMetrics );
718
719
719
720
performanceMonitoring =
Original file line number Diff line number Diff line change 12
12
import org .slf4j .Logger ;
13
13
import org .slf4j .LoggerFactory ;
14
14
15
- // Default implementation of RumInjectorHealthMetrics that reports metrics to StatsDClient
15
+ // Default implementation of RumInjectorHealthMetrics that reports metrics via StatsDClient
16
+ // This class implements the RumTelemetryCollector interface, which is used to collect telemetry
17
+ // from the RumInjector in the internal-api module
16
18
public class DefaultRumInjectorHealthMetrics extends RumInjectorHealthMetrics
17
19
implements RumTelemetryCollector {
18
20
private static final Logger log = LoggerFactory .getLogger (DefaultRumInjectorHealthMetrics .class );
Original file line number Diff line number Diff line change 1
1
package datadog .trace .core .monitor ;
2
2
3
- // Abstract health metrics for RUM injector
4
- // This class defines the interface for monitoring RUM injection operations
3
+ // Abstract health metrics class for RUM injector
5
4
public abstract class RumInjectorHealthMetrics implements AutoCloseable {
6
5
public static RumInjectorHealthMetrics NO_OP = new RumInjectorHealthMetrics () {};
7
6
Original file line number Diff line number Diff line change @@ -126,21 +126,25 @@ public byte[] getMarkerBytes(String encoding) {
126
126
return this .markerCache .computeIfAbsent (encoding , MARKER_BYTES );
127
127
}
128
128
129
+ // set the telemetry collector for the RumInjector
129
130
public static void setTelemetryCollector (RumTelemetryCollector collector ) {
130
131
telemetryCollector = collector != null ? collector : RumTelemetryCollector .NO_OP ;
131
132
}
132
133
133
- // report that the RUM injector succeeded in injecting the SDK in an HTTP response
134
+ // report to the telemetry collector that the RUM injector succeeded in injecting the SDK in an
135
+ // HTTP response
134
136
public static void reportInjectionSucceed () {
135
137
telemetryCollector .onInjectionSucceed ();
136
138
}
137
139
138
- // report that the RUM injector failed to inject the SDK in an HTTP response
140
+ // report to the telemetry collector that the RUM injector failed to inject the SDK in an HTTP
141
+ // response
139
142
public static void reportInjectionFailed () {
140
143
telemetryCollector .onInjectionFailed ();
141
144
}
142
145
143
- // report that the RUM injector skipped injecting the SDK in an HTTP response
146
+ // report to the telemetry collector that the RUM injector skipped injecting the SDK in an HTTP
147
+ // response
144
148
public static void reportInjectionSkipped () {
145
149
telemetryCollector .onInjectionSkipped ();
146
150
}
Original file line number Diff line number Diff line change 1
1
package datadog .trace .api .rum ;
2
2
3
- // Collect RUM injection telemetry
3
+ // Collect RUM injection telemetry from the RumInjector
4
+ // This is implemented by the DefaultRumInjectorHealthMetrics class in the dd-trace-core module
4
5
public interface RumTelemetryCollector {
5
6
6
7
RumTelemetryCollector NO_OP =
You can’t perform that action at this time.
0 commit comments