honganan opened a new issue #6766:
URL: https://github.com/apache/skywalking/issues/6766
I glad to found the `EndpointNameGrouping` feature, and it can really solve
problems that many enterprises will face.
### Bug
`SourceBuilder` using `NamingControl` to do endpoint name length format and
`end-name-grouping` when `setSourceEndpointName` or `setDestEndpointName`
invoked. But `NameControl` dependence `serviceName` to finish the group
matching according to the code:
```java
@Getter
private String destServiceName;
public void setDestServiceName(final String destServiceName) {
this.destServiceName =
namingControl.formatServiceName(destServiceName);
}
@Getter
@Setter
private NodeType destNodeType;
@Getter
private String destServiceInstanceName;
public void setDestServiceInstanceName(final String
destServiceInstanceName) {
this.destServiceInstanceName =
namingControl.formatServiceName(destServiceInstanceName);
}
```
But this time the `serviceName` may not have been set. When using
`SourceBuilder` in `MultiScopesAnalysisListener`, there are many place that set
endpoint name first and service name later, like L118~L120
```java
sourceBuilder.setDestEndpointName(span.getOperationName());
sourceBuilder.setDestServiceInstanceName(segmentObject.getServiceInstance());
sourceBuilder.setDestServiceName(segmentObject.getService());
```
### Requirement or improvement
The fastest way to solve is change the set methods invoking order. But it's
too easy to make a mistake as it depends on set method calling order.
I suggest adding a `namingFormat()` method in `SourceBuilder` and call it
manually after properties set. How do you think?
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]