Allow calling `lang.groovy.GString` in DSL (#13073)
This commit is contained in:
parent
2e9c9b45dd
commit
dd10e524e0
|
|
@ -75,6 +75,7 @@
|
|||
* Add a fail-safe mechanism to prevent traffic metrics inconsistent between in-memory and database server.
|
||||
* Add more clear logs when oap-cluster-internal data(metrics/traffic) format is inconsistent.
|
||||
* Optimize metrics cache loading when trace latency greater than cache timeout.
|
||||
* Allow calling `lang.groovy.GString` in DSL.
|
||||
|
||||
#### UI
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@
|
|||
package org.apache.skywalking.oap.log.analyzer.dsl;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import groovy.lang.GString;
|
||||
import groovy.lang.GroovyShell;
|
||||
import groovy.transform.CompileStatic;
|
||||
import groovy.util.DelegatingScript;
|
||||
|
|
@ -78,6 +80,7 @@ public class DSL {
|
|||
.add(Map.class)
|
||||
.add(List.class)
|
||||
.add(Array.class)
|
||||
.add(GString.class)
|
||||
.add(String.class)
|
||||
.add(ProcessRegistry.class)
|
||||
.build());
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ package org.apache.skywalking.oap.meter.analyzer.dsl;
|
|||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import groovy.lang.Binding;
|
||||
import groovy.lang.GString;
|
||||
import groovy.lang.GroovyShell;
|
||||
import groovy.util.DelegatingScript;
|
||||
import java.lang.reflect.Array;
|
||||
|
|
@ -78,6 +79,8 @@ public final class DSL {
|
|||
.add(DetectPoint.class)
|
||||
.add(Layer.class)
|
||||
.add(ProcessRegistry.class)
|
||||
.add(GString.class)
|
||||
.add(String.class)
|
||||
.build());
|
||||
cc.addCompilationCustomizers(secureASTCustomizer);
|
||||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ public class ExpressionParsingTest {
|
|||
return Arrays.asList(new Object[][] {
|
||||
{
|
||||
"all",
|
||||
"(foo - 1).tagEqual('bar', '1').sum(['tt']).irate().histogram().histogram_percentile([50,99]).service(['rr'], Layer.GENERAL).downsampling(LATEST)",
|
||||
"(foo - 1).tag({ tags -> tags.new_name = \"${tags['tag1']}|${tags['tag2']}\".toString() }).tagEqual('bar', '1').sum(['tt']).irate().histogram().histogram_percentile([50,99]).service(['rr'], Layer.GENERAL).downsampling(LATEST)",
|
||||
ExpressionParsingContext.builder()
|
||||
.samples(Collections.singletonList("foo"))
|
||||
.scopeType(ScopeType.SERVICE)
|
||||
|
|
|
|||
Loading…
Reference in New Issue