Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is this an error example in the document? #7093

Closed
xdRight opened this issue Jun 10, 2021 · 2 comments · Fixed by #7098
Closed

Is this an error example in the document? #7093

xdRight opened this issue Jun 10, 2021 · 2 comments · Fixed by #7098
Labels
bug Something isn't working and you are sure it's a bug! documentation Provide documents related issue or pull request only. good first issue Good first issue for beginners
Milestone

Comments

@xdRight
Copy link
Contributor

xdRight commented Jun 10, 2021

When I follow the example from document to add the OAL to the /config/oal/core.oal
image

2021-06-09 22:32:37,500 - org.apache.skywalking.oal.rt.OALRuntime - 420 [main] ERROR [] - Can't generate method doEndpointAbnormal for EndpointDispatcher.
javassist.CannotCompileException: [source error] syntax error near "rce.get*())

);

org"
	at javassist.CtNewMethod.make(CtNewMethod.java:84) ~[javassist-3.25.0-GA.jar:?]
	at javassist.CtNewMethod.make(CtNewMethod.java:50) ~[javassist-3.25.0-GA.jar:?]
	at org.apache.skywalking.oal.rt.OALRuntime.generateDispatcherClass(OALRuntime.java:418) [oal-rt-8.5.0.jar:8.5.0]
	at org.apache.skywalking.oal.rt.OALRuntime.generateClassAtRuntime(OALRuntime.java:197) [oal-rt-8.5.0.jar:8.5.0]
	at org.apache.skywalking.oal.rt.OALRuntime.start(OALRuntime.java:166) [oal-rt-8.5.0.jar:8.5.0]
	at org.apache.skywalking.oap.server.core.oal.rt.OALEngineLoaderService.load(OALEngineLoaderService.java:65) [server-core-8.5.0.jar:8.5.0]
	at org.apache.skywalking.oap.server.analyzer.provider.AnalyzerModuleProvider.start(AnalyzerModuleProvider.java:116) [agent-analyzer-8.5.0.jar:8.5.0]
	at org.apache.skywalking.oap.server.library.module.BootstrapFlow.start(BootstrapFlow.java:49) [library-module-8.5.0.jar:8.5.0]
	at org.apache.skywalking.oap.server.library.module.ModuleManager.init(ModuleManager.java:60) [library-module-8.5.0.jar:8.5.0]
	at org.apache.skywalking.oap.server.starter.OAPServerBootstrap.start(OAPServerBootstrap.java:43) [server-bootstrap-8.5.0.jar:8.5.0]
	at org.apache.skywalking.oap.server.starter.OAPServerStartUp.main(OAPServerStartUp.java:26) [server-starter-8.5.0.jar:8.5.0]
Caused by: javassist.compiler.SyntaxError: syntax error near "rce.get*())

);

org"
	at javassist.compiler.Parser.parsePrimaryExpr(Parser.java:1268) ~[javassist-3.25.0-GA.jar:?]
	at javassist.compiler.Parser.parsePostfix(Parser.java:1045) ~[javassist-3.25.0-GA.jar:?]
	at javassist.compiler.Parser.parseUnaryExpr(Parser.java:900) ~[javassist-3.25.0-GA.jar:?]
	at javassist.compiler.Parser.parseBinaryExpr(Parser.java:790) ~[javassist-3.25.0-GA.jar:?]
	at javassist.compiler.Parser.parseConditionalExpr(Parser.java:735) ~[javassist-3.25.0-GA.jar:?]
	at javassist.compiler.Parser.parseExpression(Parser.java:715) ~[javassist-3.25.0-GA.jar:?]
	at javassist.compiler.Parser.parsePrimaryExpr(Parser.java:1257) ~[javassist-3.25.0-GA.jar:?]
	at javassist.compiler.Parser.parsePostfix(Parser.java:1045) ~[javassist-3.25.0-GA.jar:?]
	at javassist.compiler.Parser.parseCast(Parser.java:933) ~[javassist-3.25.0-GA.jar:?]
	at javassist.compiler.Parser.parseUnaryExpr(Parser.java:898) ~[javassist-3.25.0-GA.jar:?]
	at javassist.compiler.Parser.binaryExpr2(Parser.java:821) ~[javassist-3.25.0-GA.jar:?]
	at javassist.compiler.Parser.parseBinaryExpr(Parser.java:796) ~[javassist-3.25.0-GA.jar:?]
	at javassist.compiler.Parser.parseConditionalExpr(Parser.java:735) ~[javassist-3.25.0-GA.jar:?]
	at javassist.compiler.Parser.parseExpression(Parser.java:715) ~[javassist-3.25.0-GA.jar:?]
	at javassist.compiler.Parser.parsePrimaryExpr(Parser.java:1257) ~[javassist-3.25.0-GA.jar:?]
	at javassist.compiler.Parser.parsePostfix(Parser.java:1045) ~[javassist-3.25.0-GA.jar:?]
	at javassist.compiler.Parser.parseCast(Parser.java:933) ~[javassist-3.25.0-GA.jar:?]
	at javassist.compiler.Parser.parseUnaryExpr(Parser.java:898) ~[javassist-3.25.0-GA.jar:?]
	at javassist.compiler.Parser.parseCast(Parser.java:921) ~[javassist-3.25.0-GA.jar:?]
	at javassist.compiler.Parser.parseUnaryExpr(Parser.java:898) ~[javassist-3.25.0-GA.jar:?]
	at javassist.compiler.Parser.parseBinaryExpr(Parser.java:790) ~[javassist-3.25.0-GA.jar:?]
	at javassist.compiler.Parser.parseConditionalExpr(Parser.java:735) ~[javassist-3.25.0-GA.jar:?]
	at javassist.compiler.Parser.parseExpression(Parser.java:715) ~[javassist-3.25.0-GA.jar:?]
	at javassist.compiler.Parser.parseArgumentList(Parser.java:1340) ~[javassist-3.25.0-GA.jar:?]
	at javassist.compiler.Parser.parseMethodCall(Parser.java:1192) ~[javassist-3.25.0-GA.jar:?]
	at javassist.compiler.Parser.parsePostfix(Parser.java:1050) ~[javassist-3.25.0-GA.jar:?]
	at javassist.compiler.Parser.parseUnaryExpr(Parser.java:900) ~[javassist-3.25.0-GA.jar:?]
	at javassist.compiler.Parser.parseBinaryExpr(Parser.java:790) ~[javassist-3.25.0-GA.jar:?]
	at javassist.compiler.Parser.parseConditionalExpr(Parser.java:735) ~[javassist-3.25.0-GA.jar:?]
	at javassist.compiler.Parser.parseExpression(Parser.java:715) ~[javassist-3.25.0-GA.jar:?]
	at javassist.compiler.Parser.parseDeclarationOrExpression(Parser.java:608) ~[javassist-3.25.0-GA.jar:?]
	at javassist.compiler.Parser.parseStatement(Parser.java:295) ~[javassist-3.25.0-GA.jar:?]
	at javassist.compiler.Parser.parseBlock(Parser.java:307) ~[javassist-3.25.0-GA.jar:?]
	at javassist.compiler.Parser.parseMethod2(Parser.java:172) ~[javassist-3.25.0-GA.jar:?]
	at javassist.compiler.Javac.compileMethod(Javac.java:156) ~[javassist-3.25.0-GA.jar:?]
	at javassist.compiler.Javac.compile(Javac.java:102) ~[javassist-3.25.0-GA.jar:?]
	at javassist.CtNewMethod.make(CtNewMethod.java:79) ~[javassist-3.25.0-GA.jar:?]
	... 10 more
2021-06-09 22:32:37,504 - org.apache.skywalking.oal.rt.OALRuntime - 424 [main] ERROR [] - Method body as following
private void doEndpointAbnormal(org.apache.skywalking.oap.server.core.source.Endpoint source) {
org.apache.skywalking.oap.server.core.source.oal.rt.metrics.EndpointAbnormalMetrics metrics = new org.apache.skywalking.oap.server.core.source.oal.rt.metrics.EndpointAbnormalMetrics();

        if (!new org.apache.skywalking.oap.server.core.analysis.metrics.expression.InMatch().match(source.getResponseCode(), new long[]{404,500,503})) {
        return;
        }

metrics.setTimeBucket(source.getTimeBucket());
    metrics.setEntityId(source.getEntityId());
    metrics.setServiceId(source.getServiceId());
metrics.combine(
        (long)(source.get*())

);

org.apache.skywalking.oap.server.core.analysis.worker.MetricsStreamProcessor.getInstance().in(metrics);
}

After I modified the sum to count, it works well.

Question

Is this an error example in the document?

I use skywalking 8.5.0, centos 7 and jdk8

@wu-sheng
Copy link
Member

Yes, this is a doc issue. It should be count, could you send a pull request to fix the master branch and others on website-docs/* branches?

@wu-sheng wu-sheng added bug Something isn't working and you are sure it's a bug! documentation Provide documents related issue or pull request only. good first issue Good first issue for beginners labels Jun 10, 2021
@xdRight
Copy link
Contributor Author

xdRight commented Jun 10, 2021

I will try.

xdRight added a commit to xdRight/skywalking that referenced this issue Jun 10, 2021
- sum should be modified to count
- the endpointName not in the scope of endpointName, should be modified to name
@wu-sheng wu-sheng added this to the 8.7.0 milestone Jun 10, 2021
xdRight added a commit to xdRight/skywalking that referenced this issue Jun 10, 2021
- sum should be modified to count
- the endpointName not in the scope of Endpoint, should be modified to name
xdRight added a commit to xdRight/skywalking that referenced this issue Jun 10, 2021
- sum should be modified to count
- the endpointName not in the scope of Endpoint, should be modified to name
xdRight added a commit to xdRight/skywalking that referenced this issue Jun 10, 2021
- sum should be modified to count
- the endpointName not in the scope of Endpoint, should be modified to name
xdRight added a commit to xdRight/skywalking that referenced this issue Jun 10, 2021
- sum should be modified to count
- the endpointName not in the scope of Endpoint, should be modified to name
xdRight added a commit to xdRight/skywalking that referenced this issue Jun 10, 2021
- sum should be modified to count
- the endpointName not in the scope of Endpoint, should be modified to name
wu-sheng pushed a commit that referenced this issue Jun 10, 2021
- sum should be modified to count
- the endpointName not in the scope of Endpoint, should be modified to name
wu-sheng pushed a commit that referenced this issue Jun 10, 2021
- sum should be modified to count
- the endpointName not in the scope of Endpoint, should be modified to name
wu-sheng pushed a commit that referenced this issue Jun 10, 2021
- sum should be modified to count
- the endpointName not in the scope of Endpoint, should be modified to name
wu-sheng pushed a commit that referenced this issue Jun 10, 2021
wu-sheng pushed a commit that referenced this issue Jun 10, 2021
wu-sheng pushed a commit that referenced this issue Jun 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working and you are sure it's a bug! documentation Provide documents related issue or pull request only. good first issue Good first issue for beginners
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants