@@ -29,6 +29,9 @@ public final class RumInjector {
29
29
private final DDCache <String , byte []> markerCache ;
30
30
private final Function <String , byte []> snippetBytes ;
31
31
32
+ // Health metrics telemetry collector (set by CoreTracer)
33
+ private static volatile RumTelemetryCollector telemetryCollector = RumTelemetryCollector .NO_OP ;
34
+
32
35
RumInjector (Config config , InstrumenterConfig instrumenterConfig ) {
33
36
boolean rumEnabled = instrumenterConfig .isRumEnabled ();
34
37
RumInjectorConfig injectorConfig = config .getRumInjectorConfig ();
@@ -122,4 +125,23 @@ public byte[] getMarkerBytes(String encoding) {
122
125
}
123
126
return this .markerCache .computeIfAbsent (encoding , MARKER_BYTES );
124
127
}
128
+
129
+ public static void setTelemetryCollector (RumTelemetryCollector collector ) {
130
+ telemetryCollector = collector != null ? collector : RumTelemetryCollector .NO_OP ;
131
+ }
132
+
133
+ // report that the RUM injector succeeded in injecting the SDK in an HTTP response
134
+ public static void reportInjectionSucceed () {
135
+ telemetryCollector .onInjectionSucceed ();
136
+ }
137
+
138
+ // report that the RUM injector failed to inject the SDK in an HTTP response
139
+ public static void reportInjectionFailed () {
140
+ telemetryCollector .onInjectionFailed ();
141
+ }
142
+
143
+ // report that the RUM injector skipped injecting the SDK in an HTTP response
144
+ public static void reportInjectionSkipped () {
145
+ telemetryCollector .onInjectionSkipped ();
146
+ }
125
147
}
0 commit comments