RANGER-3905: Ranger metrics on audit throughput for each of the Ranger Service plugins - #1154
Open
RakeshGuptaDev wants to merge 2 commits into
Open
RANGER-3905: Ranger metrics on audit throughput for each of the Ranger Service plugins#1154RakeshGuptaDev wants to merge 2 commits into
RakeshGuptaDev wants to merge 2 commits into
Conversation
…r Service plugins
RakeshGuptaDev
force-pushed
the
RANGER-3905_master
branch
from
August 13, 2026 15:17
d42489b to
b0a1408
Compare
RakeshGuptaDev
marked this pull request as ready for review
August 13, 2026 15:18
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Solr-backed audit-throughput “metrics” APIs to Ranger Admin, exposing latest, hourly (today), and daily (N days) audit counts per service/plugin dimensions, and wires them into Ranger’s API-access control list/mapping.
Changes:
- Implemented new
AuditMetricsRESTendpoints under/audit/*and added corresponding API-list entries + UI-tab mapping. - Extended
SolrAccessAuditsServicewith Solr JSON-facet queries to produce latest/hourly/daily audit throughput metrics and new DTO/view list wrappers. - Added unit tests for the new REST resource and metrics-query behavior; extended
RangerSearchUtil/SearchFilterto accept new query params (clientIP,appId).
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| security-admin/src/main/java/org/apache/ranger/rest/AuditMetricsREST.java | New REST resource exposing audit metrics endpoints and input validation for olderThanInDays. |
| security-admin/src/main/java/org/apache/ranger/solr/SolrAccessAuditsService.java | New Solr JSON-facet query logic and result extraction for metrics (latest/list/by-hours/by-days). |
| security-admin/src/main/java/org/apache/ranger/security/context/RangerAPIList.java | Registers new API names for authorization. |
| security-admin/src/main/java/org/apache/ranger/security/context/RangerAPIMapping.java | Associates new audit-metrics APIs with the Audit tab. |
| security-admin/src/main/java/org/apache/ranger/common/RangerSearchUtil.java | Adds request-to-SearchFilter mapping for clientIP and appId. |
| agents-common/src/main/java/org/apache/ranger/plugin/util/SearchFilter.java | Adds new filter keys used by metrics endpoints (clientIP, appId). |
| agents-common/src/main/java/org/apache/ranger/plugin/model/RangerAuditMetrics.java | New DTO for latest/list audit-metrics results. |
| agents-common/src/main/java/org/apache/ranger/plugin/model/RangerAuditMetricsByHours.java | New DTO for hourly metrics results. |
| agents-common/src/main/java/org/apache/ranger/plugin/model/RangerAuditMetricsByDays.java | New DTO for daily metrics results. |
| security-admin/src/main/java/org/apache/ranger/view/RangerAuditMetricsList.java | New VList wrapper for audit metrics list responses. |
| security-admin/src/main/java/org/apache/ranger/view/RangerAuditMetricsListByHours.java | New VList wrapper for hourly metrics responses. |
| security-admin/src/main/java/org/apache/ranger/view/RangerAuditMetricsListByDays.java | New VList wrapper for daily metrics responses. |
| security-admin/src/test/java/org/apache/ranger/rest/TestAuditMetricsREST.java | Unit tests for AuditMetricsREST. |
| security-admin/src/test/java/org/apache/ranger/solr/SolrAccessAuditsServiceTest.java | Unit tests for Solr metrics extraction/query behaviors. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…r Service plugins - fix review comment
RakeshGuptaDev
force-pushed
the
RANGER-3905_master
branch
from
August 14, 2026 17:42
64c5074 to
0e305f8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Implement new Solr-backed REST APIs to expose audit throughput metrics for each Ranger service plugin.
Endpoints:
/audit/metrics
/audit/metrics/{id}
/audit/metrics/servicetype/{type}/servicename/{name}
/audit/dailymetrics
/audit/daysmetrics
How was this patch tested?
Successfully validated the newly added Solr-backed REST APIs for Ranger audit throughput metrics:
/audit/metrics
/audit/metrics/{id}
/audit/metrics/servicetype/{type}/servicename/{name}
/audit/dailymetrics
/audit/daysmetrics
Security Validation: Confirmed that unauthorized access attempts by accounts with ROLE_USER correctly return an HTTP 403 Forbidden status.