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