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

Example: https://kg-rzmtr-1.kg-rzmtr.root.hwx.site:6182/service/metrics/json

Prometheus compatible API:

accessible at a url with format:

http(s)://<ADMIN_HOST>:<ADMIN_PORT>/service/metrics/prometheus

Example: https://kg-rzmtr-1.kg-rzmtr.root.hwx.site:6182/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.

Row Filtering: This group of metrics indicates row filtering policy metrics. Currently we only support total row filtering count metrics.

Masking: This group of metrics indicates masking policy metrics. Currently we only support total masking count metrics.

Resource Access: This group of metrics indicates resource access policy metrics. Other than total resource access policy count, it also gives component specific resource access policy count.

Sample json follows:
"Policy": {
        ….
        "ResourceAccessCount": 95,
        "ResourceAccessCountHIVE": 10,
        "ResourceAccessCountKAFKA": 12,
        "ResourceAccessCountATLAS": 9,
        "ResourceAccessCountKUDU": 3,
        "ResourceAccessCountHDFS": 3,
        ….
    } 
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
    }
}
Table 1. Ranger JVM Admin Metrics Descriptions
Metric Descriptions
GcTimeTotal Total time taken by JVM Garbage Collector.
GcTimeMax Maximum time taken by a single JVM Garbage Collection process.
GcCountTotal Number of times JVM Garbage Collector runs.
SystemLoadAvg Average load on the host on which the service is running.
ThreadsBusy Total JVM threads which are busy.
ThreadsWaiting Total JVM threads which are waiting.
ThreadsBlocked Total JVM threads which are blocked.
ThreadsRemaining Total remaining (not busy/ waiting/ blocked) JVM threads.
MemoryMax Maximum memory (RAM) JVM can get from the host.
MemoryCurrent Currently occupied memory (RAM) by JVM.
ProcessorsAvailable Currently available processor cores on host.