@@ -68,21 +68,17 @@ public GetOnlineFeaturesResponse getOnlineFeatures(GetOnlineFeaturesRequest requ
6868 GetOnlineFeaturesResponse .newBuilder ();
6969 List <FeatureSetRequest > featureSetRequests =
7070 specService .getFeatureSets (request .getFeaturesList ());
71- scope .span ().log (ImmutableMap .of ("event" , "featureSetRequests" , "value" , featureSetRequests ));
72-
7371 List <EntityRow > entityRows = request .getEntityRowsList ();
74- scope .span ().log (ImmutableMap .of ("event" , "entityRows" , "value" , entityRows ));
75-
7672 Map <EntityRow , Map <String , Value >> featureValuesMap =
7773 entityRows .stream ()
7874 .collect (Collectors .toMap (row -> row , row -> Maps .newHashMap (row .getFieldsMap ())));
79- scope .span ().log (ImmutableMap .of ("event" , "featureValuesMap" , "value" , featureValuesMap ));
80-
8175 // Get all feature rows from the retriever. Each feature row list corresponds to a single
8276 // feature set request.
8377 List <List <FeatureRow >> featureRows =
8478 retriever .getOnlineFeatures (entityRows , featureSetRequests );
85- scope .span ().log (ImmutableMap .of ("event" , "featureRows" , "value" , featureRows ));
79+ if (scope != null ) {
80+ scope .span ().log (ImmutableMap .of ("event" , "featureRows" , "value" , featureRows ));
81+ }
8682
8783 // For each feature set request, read the feature rows returned by the retriever, and
8884 // populate the featureValuesMap with the feature values corresponding to that entity row.
@@ -136,8 +132,6 @@ public GetOnlineFeaturesResponse getOnlineFeatures(GetOnlineFeaturesRequest requ
136132 featureValuesMap .values ().stream ()
137133 .map (valueMap -> FieldValues .newBuilder ().putAllFields (valueMap ).build ())
138134 .collect (Collectors .toList ());
139- scope .span ().log (ImmutableMap .of ("event" , "fieldValues" , "value" , fieldValues ));
140-
141135 return getOnlineFeaturesResponseBuilder .addAllFieldValues (fieldValues ).build ();
142136 }
143137 }
0 commit comments