Skip to content

Commit 75254eb

Browse files
committed
improve comments on jexl setup and future work
1 parent d509135 commit 75254eb

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

instrumentation/nocode/src/main/java/com/splunk/opentelemetry/instrumentation/nocode/JexlEvaluator.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,16 @@ public class JexlEvaluator implements NocodeEvaluation.Evaluator {
3131
private final JexlEngine jexl;
3232

3333
public JexlEvaluator() {
34-
JexlFeatures features = new JexlFeatures().register(false).comparatorNames(false);
35-
// The "unrestricted" permissions allows jexl to introspect on custom/non-stdlib classes
36-
// for calling methods
34+
JexlFeatures features =
35+
new JexlFeatures()
36+
.register(false) // don't support #register syntax
37+
.comparatorNames(false); // don't support 'lt' as an alternative to '<'
3738
this.jexl =
3839
new JexlBuilder()
3940
.features(features)
41+
// "unrestricted" means "can introspect on custom classes"
4042
.permissions(JexlPermissions.UNRESTRICTED)
43+
// don't support ant syntax
4144
.antish(false)
4245
.create();
4346
}

instrumentation/nocode/src/main/java/com/splunk/opentelemetry/instrumentation/nocode/YamlParser.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
public final class YamlParser {
3535
private static final Logger logger = Logger.getLogger(YamlParser.class.getName());
36-
// FIXME support method override selection - e.g., with classfile method signature or something
36+
// FUTURE support method override selection - e.g., with classfile method signature or something
3737
private static final String NOCODE_YMLFILE = "splunk.otel.instrumentation.nocode.yml.file";
3838

3939
private final List<NocodeRules.Rule> instrumentationRules;
@@ -68,6 +68,7 @@ private static List<NocodeRules.Rule> loadUnsafe(String yamlFileName) throws Exc
6868
for (Object yamlBit : parsedYaml) {
6969
List<Map<String, Object>> rulesMap = (List<Map<String, Object>>) yamlBit;
7070
for (Map<String, Object> yamlRule : rulesMap) {
71+
// FUTURE support more complex class selection (inherits-from, etc.)
7172
String className = yamlRule.get("class").toString();
7273
String methodName = yamlRule.get("method").toString();
7374
String spanName =

0 commit comments

Comments
 (0)