[#14036] Move agent list endpoint out of admin API#14059
Conversation
28940ad to
788be12
Compare
There was a problem hiding this comment.
Pull request overview
Moves the agent-list endpoint out of the admin API surface into AgentV2Controller, consolidating agent retrieval under /api/agents with service-type resolution handled via ServiceTypeRegistryService.
Changes:
- Removed
/api/admin/agentsfromAdminController(and itsAgentListV2Servicedependency). - Updated
AgentV2Controllerto (a) useIntegerforserviceTypeCode, and (b) add a second/agentshandler to return the full agent list whenfrom/toare not provided. - Simplified the “invalid service type” error message.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/AgentV2Controller.java | Adds/adjusts /api/agents endpoints for active vs all agents and updates serviceType resolution. |
| web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/AdminController.java | Removes the admin-scoped agents endpoint and related wiring. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| private ServiceType findServiceType(Short serviceTypeCode, String serviceTypeName) { | ||
| @PreAuthorize("@naverPermissionEvaluator.hasInspectorPermission(#serviceName.getName(), #applicationName)") | ||
| @GetMapping(value = "/agents",, params = {"applicationName", "!from", "!to"}) |
| @PreAuthorize("@naverPermissionEvaluator.hasInspectorPermission(#serviceName.getName(), #applicationName)") | ||
| @GetMapping(value = "/agents",, params = {"applicationName", "!from", "!to"}) | ||
| public List<AgentIdView> getAgents( |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/AgentV2Controller.java:90
@GetMappinghas a stray extra comma after the path value, which will not compile and will prevent Spring from registering this handler.
@GetMapping(value = "/agents",, params = {"applicationName", "!from", "!to"})
f50e8f1 to
645f483
Compare
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/AgentV2Controller.java:92
- This second
/agentshandler is also namedgetAgents, which overloads the other handler method name in the same controller. Renaming it to something specific (e.g.,getAllAgents) avoids ambiguity in logs/stack traces and clarifies intent for future readers.
@GetMapping(value = "/agents", params = {"applicationName", "!from", "!to"})
public List<AgentIdView> getAgents(
@ServiceParam ServiceName serviceName,
| @GetMapping(value = "/agents", params = {"applicationName", "from", "to"}) | ||
| public List<AgentIdView> getAgentsV2( | ||
| public List<AgentIdView> getAgents( |
788be12 to
f50e8f1
Compare



No description provided.