Monitoring Agent

This page describes how to monitor the Agent.

Agent exports metrics under the /metrics path on its profiling port. The metrics can be fetched with curl:

$ curl http://localhost:11102/metrics

yorkie_agent_version{agent_version="0.2.0"} 1
# HELP yorkie_pushpull_received_changes_total The total count of changes included
# TYPE yorkie_pushpull_received_changes_total counter
yorkie_pushpull_received_changes_total 6
...

This metrics can be collected from Prometheus.

Prometheus and Grafana

Running Prometheus and Grafana is the easiest way to monitor Agent’s metrics.

First, downloads all manifests files from docker folder. Then let’s start the applications with docker-compose:

$ docker-compose -f docker-compose-monitoring.yml up --build -d

Creating prometheus ... done
Creating grafana    ... done

Now Prometheus will collect Agent metrics every 10 seconds.

Grafana has built-in Prometheus support; just add a Prometheus data source:

Name:   prometheus
Type:   Prometheus
Url:    http://localhost:9090
Access: proxy

Then import the default yorkie dashboard template and customize. For instance, if Prometheus data source name is my-prometheus, the datasource field values in JSON also need to be my-prometheus.

Sample dashboard:

Edit this page