Monitoring
Data Access can be configured to report metrics about data ingested and queries serviced, which can be reported to a monitoring endpoint. The actual scraping of these metrics is done by the Insights sidecar container which uses the kxi-sidecar
image, and can be be set to report to an event monitoring and alerting application such as Prometheus.
Current statistics reported by Data Access Processes are:
Component | Name | Type | Description |
---|---|---|---|
DA | da_state |
gauge | Current state of DA process (see .msvc.procState ) |
DA | da_purview_start |
gauge | Start timestamp of DA purview |
DA | da_purview_end |
gauge | End timestamp of DA purview |
DA | da_msgs |
counter | Number of inbound messages in interval |
DA | da_msgs_latency |
summary | Latency (in ms) of inbound messages in interval |
DA | da_record_count |
counter | Count of records received in interval |
DA | da_requests |
counter | Count of requests received in interval |
DA | da_failed_requests |
counter | Count of failed requests received in interval |
DA | da_request_time |
summary | Duration of requests received in interval |
Configuration:
A Docker Compose example of how to setup the kxi-sidecar
and Prometheus in an environment is detailed below. First in the Docker Compose file, the sidecar and the prometheus processes need to added.
rdb: # Data Access Process RDB
image: kxi-da
command: -p 5080
environment:
- KXI_NAME=rdb
- KXI_PORT=5080
- KXI_SC=RDB
- KXI_ASSEMBLY_FILE=/opt/kx/cfg/assembly/assembly.yml
networks:
- kx
rdb-sidecar: # Sidecar for data access process named RDB
image: kxi_sidecar:0.9.0 # Can be pulled from Insights repo
command: -p 8080
environment:
- KXI_CONFIG_FILE=/opt/kx/cfg/docker/rdb.json
networks:
- kx
volumes:
- ./config:/etc/kx/cfg # Make rdb.json available to container
prometheus: # Prometheus monitoring
image: prometheus
command: --config.file=/etc/prometheus/prometheus.yml
ports:
- "8080:8080"
networks:
- kx
volumes:
- ./config:/etc/prometheus # Make prometheus configuration available
An example rdb.json
file is shown below. In it the connection
field points to the main DAP container and is set to scrape the container every 5 seconds through metrics.frequency
.
{
"connection": ":rdb_1:5080",
"frequencySecs": 5,
"metrics":
{
"enabled":"true",
"frequency": 5,
"handler": {
"pc": true,
"pg": true,
"ph": true,
"po": true,
"pp": true,
"ps": true,
"ts": true,
"wc": true,
"wo": true,
"ws": true
}
}
}
An example prometheus.yml
set to scrape every 15 seconds and set to actively scrape from the sidecar process is shown below.
global:
scrape_interval: 15s # By default, scrape targets every 15 seconds.
evaluation_interval: 15s # Evaluate rules every 15 seconds.
scrape_configs:
- job_name: 'rdb-monitoring'
static_configs:
- targets: ['rdb-sidecar_1:8080'] # Point to RDB's sidecar