IAM statistics
IAM server has the ability of collecting its stats data of CPU, memory, requests,
response and so on. IAM collects the stats data through StatsD Protocol
. User can
use these data to monitor the healthy of the IAM, and monitor the requests distribution.
Configuration settings
IAM has below statistics config settings, and all these settings have
the statsConfig.
prefix.
Setting Name | Default Value | Description |
---|---|---|
isEnabled | false | Enable the statistics feature or not |
host | localhost | The host to send the stats to |
port | 8125 | The port to send the stats to |
protocol | udp | The protocol to be used by IAM to transfer the data to the statsd server. The value can be udp or tcp |
interval | 10000 | The time interval in ms to flush the data to the host |
format | telegraf | The stats data concrete format to be sent to the host. The value can be telgraf or statsd |
debug | false | Output some debug info into console for debug the statistics issue |
Enable the statistics
The statistics feature is disabled by default. User need do below steps to enable the statistics feature:
- Open IAM's local.properties from <iam_root>/config/ directory
- Add below 2 lints into it:
statsConfig.isEnabled = true statsConfig.host = <Your_statsd_server_host>
Data collected by IAM
IAM collected 3 types metrics data.
- Counting Data
- completed requests count
- successed requests count
- failed requestes count
- Timing Data
- all requests time costs
- ldap pool acquire and using time costs
- Gauges Data
- CPU usages info
- Memory usages info
- Cache info
- ldap pool info
- request count in queue
Raw sample data
Here's an sample raw data sent from IAM to stats collector server:
- Counting data:
request_completed,component=iam,host=test_server_local,process=master:6|c response_api_authorization_302,component=iam,host=test_server_local,process=master:1|c response_api_interaction_200,component=iam,host=test_server_local,process=master:1|c response_api_interaction_302,component=iam,host=test_server_local,process=master:1|c response_api_resume_302,component=iam,host=test_server_local,process=master:1|c response_api_token_200,component=iam,host=test_server_local,process=master:1|c response_api_introspection_200,component=iam,host=test_server_local,process=master:1|c
- Timing data:
api_authorization,component=iam,host=test_server_local,process=master:49|ms api_interaction,component=iam,host=test_server_local,process=master:17|ms ldap_pool_acquire,component=iam,host=test_server_local,process=master:13|ms ldap_pool_use,component=iam,host=test_server_local,process=master:15|ms api_interaction,component=iam,host=test_server_local,process=master:95|ms api_resume,component=iam,host=test_server_local,process=master:45|ms api_token,component=iam,host=test_server_local,process=master:80|ms api_introspection,component=iam,host=test_server_local,process=master:37|ms
- Gauges data:
request_in_queue,component=iam,host=test_server_local,process=master:0|g cache_count_UNID,component=iam,host=test_server_local,process=master:11|g cache_count_Session,component=iam,host=test_server_local,process=master:1|g cpu_user,component=iam,host=test_server_local,process=master:3.3440422741226064|g cpu_system,component=iam,host=test_server_local,process=master:0.4070695934939585|g memory_heapTotal,component=iam,host=test_server_local,process=master:39608320|g memory_heapUsed,component=iam,host=test_server_local,process=master:32721216|g ldap_user_pool_size,component=iam,host=test_server_local,process=master:1|g ldap_user_pool_available,component=iam,host=test_server_local,process=master:1|g ldap_admin_pool_size,component=iam,host=test_server_local,process=master:1|g ldap_admin_pool_available,component=iam,host=test_server_local,process=master:1|g
Next
Any Monitor system (Telegraf, Graphite, DogData, NewRelic, etc.) that supports "StatsD | DogStatsD" format input can collect these data and show them through dashboard.
As a reference, IAM-Dashboard
project shows how to use Telegraf to collect
data to InfluxDB and then use Grafana to present.