[#noissue] Add virtual-service mock mapping for server map - #13688
[#noissue] Add virtual-service mock mapping for server map#13688emeroad wants to merge 1 commit into
Conversation
Expand a single SERVICE-typed application into a configured group of member applications when building the server map. Mapping is loaded from `web.servermap.virtual-service` in application.yml and validated at boot via ApplicationValidator. Also adds ServiceType SERVICE (code 10).
|
There was a problem hiding this comment.
Pull request overview
Adds a virtual-service expansion path for server map requests, so a SERVICE-typed application can be resolved into configured member applications before querying map data.
Changes:
- Adds
ServiceType.SERVICEwith code10. - Adds virtual-service configuration properties and resolver.
- Wires the resolver into
MapControllerand adds resolver tests/config samples.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
commons/src/main/java/com/navercorp/pinpoint/common/trace/ServiceType.java |
Adds the SERVICE service type. |
web/src/main/java/com/navercorp/pinpoint/web/applicationmap/config/MapControllerConfiguration.java |
Enables virtual-service properties and creates/injects the resolver bean. |
web/src/main/java/com/navercorp/pinpoint/web/applicationmap/controller/MapController.java |
Resolves requested applications into member applications before building map options. |
web/src/main/java/com/navercorp/pinpoint/web/applicationmap/virtualapplication/VirtualApplicationProperties.java |
Adds configuration binding for virtual-service mappings. |
web/src/main/java/com/navercorp/pinpoint/web/applicationmap/virtualapplication/VirtualApplicationResolver.java |
Adds virtual-service mapping validation and resolution logic. |
web/src/main/resources/application.yml |
Adds commented example mappings. |
web/src/test/java/com/navercorp/pinpoint/web/applicationmap/controller/MapControllerTest.java |
Updates controller test construction for the new dependency. |
web/src/test/java/com/navercorp/pinpoint/web/applicationmap/virtualapplication/VirtualApplicationResolverTest.java |
Adds resolver behavior and validation tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| String virtualServiceName = rule.getVirtualServiceName(); | ||
| if (!StringUtils.hasLength(virtualServiceName)) { | ||
| throw new IllegalArgumentException("virtualServiceName must not be empty"); | ||
| } |
| final Application application = getApplication(appForm); | ||
| final List<Application> applications = virtualApplicationResolver.resolve(application); | ||
|
|
||
| final MapServiceOption option = new MapServiceOption | ||
| .Builder(application, timeWindow, searchOption) | ||
| .Builder(applications, timeWindow, searchOption) |
| @Bean | ||
| public VirtualApplicationResolver virtualApplicationResolver(VirtualApplicationProperties properties, | ||
| ApplicationValidator applicationValidator) { | ||
| if (!properties.isMockEnabled()) { | ||
| return VirtualApplicationResolver.emptyResolver(); | ||
| } | ||
| return VirtualApplicationResolver.of(properties.getMappings(), applicationValidator); |
| ## Service map virtual-service mock mapping rules | ||
| #web.virtual-service: | ||
| # mock-enabled: true | ||
| # mappings: | ||
| # - virtual-service-name: CAFE-SERVICE |
| VirtualApplicationResolver virtualApplicationResolver = VirtualApplicationResolver.emptyResolver(); | ||
| MapController controller = new MapController(mapProperties, mapService, applicationValidator, virtualApplicationResolver, duration); |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #13688 +/- ##
============================================
+ Coverage 32.84% 32.87% +0.03%
- Complexity 11363 11378 +15
============================================
Files 4142 4144 +2
Lines 97616 97677 +61
Branches 10297 10303 +6
============================================
+ Hits 32062 32114 +52
- Misses 62799 62805 +6
- Partials 2755 2758 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|



Expand a single SERVICE-typed application into a configured group of member applications when building the server map. Mapping is loaded from
web.servermap.virtual-servicein application.yml and validated at boot via ApplicationValidator. Also adds ServiceType SERVICE (code 10).