Skip to content

B.3: Add internal operational dashboard endpoint#74

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/create-admin-dashboard-endpoint
Draft

B.3: Add internal operational dashboard endpoint#74
Copilot wants to merge 2 commits intomainfrom
copilot/create-admin-dashboard-endpoint

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 28, 2026

Implements the /admin/top-municipios monitoring endpoint that surfaces the most-searched municipalities by aggregating Micrometer counters — hidden from public Swagger and protected behind authentication.

Changes

  • AdminDashboardController — New @Hidden @RestController at /admin/top-municipios; queries busca.municipio counters via Search.in(meterRegistry), returns top 10 sorted by search count descending ({municipio, uf, buscas})

  • BuscaController — Injects MeterRegistry; increments busca.municipio{municipio, uf} counter on every /api/busca/perfil-direto call (the data source for the dashboard)

  • SecurityConfig — Explicit .requestMatchers("/admin/**").authenticated() rule before the anyRequest catch-all

  • application.yml — Sets management.server.port: 9090; adds metrics to actuator exposure

Example response

GET /admin/top-municipios

[
  { "municipio": "Campinas", "uf": "SP", "buscas": 42 },
  { "municipio": "Manaus",   "uf": "AM", "buscas": 17 }
]

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Create internal dashboard endpoint B.3: Add internal operational dashboard endpoint Mar 28, 2026
Copilot AI requested a review from rebecanonato89 March 28, 2026 14:16
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