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 @@ -707,12 +707,13 @@ private CoreTracer(
707
707
: HealthMetrics .NO_OP ;
708
708
healthMetrics .start ();
709
709
710
+ // Start RUM injector health metrics
710
711
rumInjectorHealthMetrics =
711
712
config .isHealthMetricsEnabled () && config .isRumEnabled ()
712
713
? new DefaultRumInjectorHealthMetrics (this .statsDClient )
713
714
: RumInjectorHealthMetrics .NO_OP ;
714
715
rumInjectorHealthMetrics .start ();
715
- // Register health metrics telemetry collector with RumInjector
716
+ // Register rumInjectorHealthMetrics as the RumInjector's telemetry collector
716
717
RumInjector .setTelemetryCollector ((DefaultRumInjectorHealthMetrics ) rumInjectorHealthMetrics );
717
718
718
719
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 @@ -124,21 +124,25 @@ public byte[] getMarkerBytes(String encoding) {
124
124
return this .markerCache .computeIfAbsent (encoding , MARKER_BYTES );
125
125
}
126
126
127
+ // set the telemetry collector for the RumInjector
127
128
public static void setTelemetryCollector (RumTelemetryCollector collector ) {
128
129
telemetryCollector = collector != null ? collector : RumTelemetryCollector .NO_OP ;
129
130
}
130
131
131
- // report that the RUM injector succeeded in injecting the SDK in an HTTP response
132
+ // report to the telemetry collector that the RUM injector succeeded in injecting the SDK in an
133
+ // HTTP response
132
134
public static void reportInjectionSucceed () {
133
135
telemetryCollector .onInjectionSucceed ();
134
136
}
135
137
136
- // report that the RUM injector failed to inject the SDK in an HTTP response
138
+ // report to the telemetry collector that the RUM injector failed to inject the SDK in an HTTP
139
+ // response
137
140
public static void reportInjectionFailed () {
138
141
telemetryCollector .onInjectionFailed ();
139
142
}
140
143
141
- // report that the RUM injector skipped injecting the SDK in an HTTP response
144
+ // report to the telemetry collector that the RUM injector skipped injecting the SDK in an HTTP
145
+ // response
142
146
public static void reportInjectionSkipped () {
143
147
telemetryCollector .onInjectionSkipped ();
144
148
}
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