Ranger Admin Metrics API
One Ranger Admin API returns a response in JSON format. The other Ranger Admin API returns a response in prometheus compatible format. Neither API that fetches Ranger Admin metrics requires authentication as it does not provide any sensitive information. Both APIs return the same value. You can reduce (or increase) the metrics collection interval using the hadoop-metrics2.properties file.
You can access two APIs that fetch Ranger Admin metrics.
JSON compatible API
accessible at a url with format:
http(s)://<ADMIN_HOST>:<ADMIN_PORT>/service/metrics/json
Prometheus compatible API:
accessible at a url with format:
http(s)://<RAZ_HOST>:<RAZ_PORT>/service/metrics/prometheus
Response
The response is grouped into policy, context enrichers, service, deny conditions, user group & Ranger JVM categories. Since both APIs return the same value, only json responses are discussed in this document.
- Policy:
-
The policy group metrics gives all metrics related to policies. Further it is divided into following sub-categories.
Sample json response follows:
"Policy": { "RowFilteringCount": 0, "MaskingCount": 0, "TagAccessCount": 1, "ResourceAccessCount": 95, "ResourceAccessCountHIVE": 10, "ResourceAccessCountKAFKA": 12, "ResourceAccessCountATLAS": 9, "ResourceAccessCountKUDU": 3, "ResourceAccessCountHDFS": 3, …. }
Policy metric response can further be divided into row filtering, masking, resource access & tag policies.
- ContextEnrichers:
-
This metrics group represents the available metrics for context enrichers. Similar to the d deny conditions & policy metrics group, this metric also shares count for each service definition/ type available other than total count.
Sample json follows:
"ContextEnrichers": { "ContextEnricherCountTAG": 1, "ContextEnricherCount": 1 }
- Service:
-
This metrics group represents the available metrics for service. Similar to the context enrichers & policy metrics group, this metric also shares count for each service definition/ type available other than total count.
Sample json follows:
"Service": { "ServiceCount": 16, "ServiceCountHIVE": 1, "ServiceCountTAG": 1, "ServiceCountHBASE": 1, "ServiceCountADLS": 1, "ServiceCountKAFKA": 1, "ServiceCountS3": 1, …. }
- DenyConditions:
-
This metrics group represents the available metrics for all deny conditions. Similar to the service & policy metrics group, this metric also shares count for each service definition/ type available other than total count.
Sample json follows:
"DenyConditions": { "DenyConditionCountTAG": 1, "DenyConditionCount": 1 }
- User Group:
-
This metrics group represents the available metrics for all users & groups. Other than total user & groups it also includes role specific user counts.
Sample json follows:
"UserGroup": { "UserCount": 62, "GroupCount": 97, "UserCountKeyAdmin": 1, "UserCountKeyAdminAuditor": 0, "UserCountSysAdmin": 8, "UserCountAdminAuditor": 0, "UserCountUser": 53 }
- Ranger JVM:
-
This metrics group represents the JVM metrics needed to get internal state of admin.
Sample json follows:
"RangerJvm": { "GcTimeTotal": 5315, "SystemLoadAvg": 3.91, "ThreadsBusy": 2250, "GcCountTotal": 472, "MemoryMax": 1066401792, "MemoryCurrent": 179763416, "ThreadsWaiting": 2248, "ProcessorsAvailable": 4, "GcTimeMax": 5002, "ThreadsBlocked": 25, "ThreadsRemaining": 4 } }