Superskyyy commented on code in PR #10884:
URL: https://github.com/apache/skywalking/pull/10884#discussion_r1220237521
##########
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/config/group/EndpointNameGrouping.java:
##########
@@ -69,6 +113,40 @@ private String formatByOpenapi(String serviceName, String
endpointName) {
log.trace("Endpoint {} of Service {} keeps unchanged.",
endpointName, serviceName);
}
}
- return formatResult.getName();
+ return new Tuple2<>(formatResult.getName(), formatResult.isMatch());
+ }
+
+ public void setHttpUriRecognitionSvr(final HttpUriRecognition
httpUriRecognitionSvr) {
+ this.httpUriRecognitionSvr = httpUriRecognitionSvr;
+ Executors.newSingleThreadScheduledExecutor()
+ .scheduleWithFixedDelay(
+ new RunnableWithExceptionProtection(
+ () -> {
+ cachedHttpUris.forEach((serviceName, httpUris) ->
{
+ List<HttpUriRecognition.HTTPUri> uris
+ = httpUris.keySet()
+ .stream()
+ .map(
+ uri -> new
HttpUriRecognition.HTTPUri(
+ uri,
httpUris.get(uri).get()
+ ))
+ .collect(Collectors.toList());
+ // Reset the cache once the URIs are sent to
the recognition server.
+ httpUris.clear();
+ httpUriRecognitionSvr
+ .recognize(serviceName, uris,
+ (service, patterns) -> {
+ StringFormatGroup group =
new StringFormatGroup(patterns.size());
+ patterns.forEach(
+ p ->
group.addRule(p.getFormattedUri(), p.getPattern()));
Review Comment:
Since the endpoint matching patterns/results are generated in async, is
there a mechanism (I cannot find it in current code) to update the endpoints
after results come back from ai module?
In other words, does the updated rule only work for future URIs, not the
currently just analyzed batch(since its async) and they already received a
non-formated tuple after .format?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]