@@ -211,46 +211,23 @@ public void finish(AgentSpan serviceEntrySpan) {
211211 }
212212
213213 /**
214- * Copies AppSec tags from the service-entry span to this inferred proxy span. This fulfils the
215- * RFC-1081 requirement that the inferred span contains the same AppSec tags as the service-entry
216- * span, enabling security activity to be correctly associated with the API Gateway endpoint.
214+ * Copies AppSec tags from the service-entry span to this inferred proxy span as required by
215+ * RFC-1081: the inferred span must carry {@code _dd.appsec.enabled} and {@code _dd.appsec.json}
216+ * so that security activity can be correlated with the API Gateway endpoint.
217217 */
218218 private void copyAppSecTagsFromServiceEntry (AgentSpan serviceEntrySpan ) {
219219 if (serviceEntrySpan == null || serviceEntrySpan == this .span ) {
220220 return ;
221221 }
222222
223- // Copy _dd.appsec.enabled (RFC-1081: required on inferred span)
224223 Object appsecEnabled = serviceEntrySpan .getTag ("_dd.appsec.enabled" );
225224 if (appsecEnabled != null ) {
226225 this .span .setMetric ("_dd.appsec.enabled" , 1 );
227226 }
228227
229- Object runtimeFamily = serviceEntrySpan .getTag ("_dd.runtime_family" );
230- if (runtimeFamily != null ) {
231- this .span .setTag ("_dd.runtime_family" , runtimeFamily .toString ());
232- }
233-
234- // Copy event-related tags only when AppSec events were detected
235- Object appsecEvent = serviceEntrySpan .getTag ("appsec.event" );
236- if (appsecEvent != null ) {
237- this .span .setTag ("appsec.event" , appsecEvent );
238-
239- Object networkClientIp = serviceEntrySpan .getTag ("network.client.ip" );
240- if (networkClientIp != null ) {
241- this .span .setTag ("network.client.ip" , networkClientIp .toString ());
242- }
243-
244- Object actorIp = serviceEntrySpan .getTag ("actor.ip" );
245- if (actorIp != null ) {
246- this .span .setTag ("actor.ip" , actorIp .toString ());
247- }
248-
249- // Copy _dd.appsec.json (RFC-1081: inferred span must contain same events as service-entry)
250- Object appsecJson = serviceEntrySpan .getTag ("_dd.appsec.json" );
251- if (appsecJson != null ) {
252- this .span .setTag ("_dd.appsec.json" , appsecJson .toString ());
253- }
228+ Object appsecJson = serviceEntrySpan .getTag ("_dd.appsec.json" );
229+ if (appsecJson != null ) {
230+ this .span .setTag ("_dd.appsec.json" , appsecJson .toString ());
254231 }
255232 }
256233
0 commit comments