Skip to content

[#noissue] Add virtual-service mock mapping for server map - #13688

Open
emeroad wants to merge 1 commit into
pinpoint-apm:masterfrom
emeroad:#noissue_virtualservice
Open

[#noissue] Add virtual-service mock mapping for server map#13688
emeroad wants to merge 1 commit into
pinpoint-apm:masterfrom
emeroad:#noissue_virtualservice

Conversation

@emeroad

@emeroad emeroad commented May 15, 2026

Copy link
Copy Markdown
Member

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).

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).
@emeroad
emeroad requested a review from Copilot May 15, 2026 06:28
@sonarqubecloud

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.SERVICE with code 10.
  • Adds virtual-service configuration properties and resolver.
  • Wires the resolver into MapController and 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");
}
Comment on lines 119 to +123
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)
Comment on lines +59 to +65
@Bean
public VirtualApplicationResolver virtualApplicationResolver(VirtualApplicationProperties properties,
ApplicationValidator applicationValidator) {
if (!properties.isMockEnabled()) {
return VirtualApplicationResolver.emptyResolver();
}
return VirtualApplicationResolver.of(properties.getMappings(), applicationValidator);
Comment on lines +129 to +133
## Service map virtual-service mock mapping rules
#web.virtual-service:
# mock-enabled: true
# mappings:
# - virtual-service-name: CAFE-SERVICE
Comment on lines +64 to +65
VirtualApplicationResolver virtualApplicationResolver = VirtualApplicationResolver.emptyResolver();
MapController controller = new MapController(mapProperties, mapService, applicationValidator, virtualApplicationResolver, duration);
@codecov

codecov Bot commented May 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.41935% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 32.87%. Comparing base (eec093f) to head (2c42fd9).

Files with missing lines Patch % Lines
...rtualapplication/VirtualApplicationProperties.java 62.50% 9 Missing ⚠️
...licationmap/config/MapControllerConfiguration.java 0.00% 4 Missing ⚠️
...t/web/applicationmap/controller/MapController.java 66.66% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants