Sync Metrics Export
This application can export various sync related metrics, which can be used to monitor the sync activities and status. Those metrics are exported to a file, formatted using the Influx Line Protocol.
Usage
Set the export-metrics
flag, in order to activate the exporter. The file will be written to the root of the data directory and is named .icloud-photos-sync.metrics
. This file can be consumed using telegraf's tail input plugin. The following is a sample configuration:
[[inputs.tail]]
files = ["/opt/icloud-photos-library/.icloud-photos-sync.metrics"]
data_format = "influx"
Grafana Dashboard
After importing the metrics into an InfluxDB through telegraf, you can use Grafana to visualize the data. The following example is available for download:
Metrics
All metrics are created using the measurement name icloud-photos-sync
.
The following fields will be written:
status
: Provides a string of the current sync progress status. This can include:AUTHENTICATION_STARTED
AUTHENTICATED
MFA_REQUIRED
MFA_RECEIVED
DEVICE_TRUSTED
ACCOUNT_READY
ICLOUD_READY
SYNC_START
FETCH_N_LOAD_STARTED
FETCH_N_LOAD_COMPLETED
DIFF_STARTED
DIFF_COMPLETED
WRITE_STARTED
WRITE_ASSETS_STARTED
WRITE_ASSETS_COMPLETED
WRITE_ALBUMS_STARTED
WRITE_ALBUMS_COMPLETED
WRITE_COMPLETED
SYNC_COMPLETED
SYNC_RETRY
ERROR
assetsArchived
: The amount of assets archived during an archive operationremoteAssetsDeleted
: The amount of remote assets deleted during an archive operation (if remote delete is enabled)localAssetsLoaded
: Gives the amount of local assets loaded during a synclocalAlbumsLoaded
: Gives the amount of local albums loaded during a syncremoteAssetsFetched
: Gives the amount of remote assets loaded during a syncremoteAlbumsFetched
: Gives the amount of remote albums loaded during a syncassetsToBeAdded
: Gives the amount of assets that are meant to be added after diffing the local and remote stateassetsToBeKept
: Gives the amount of assets that are meant to be kept after diffing the local and remote stateassetsToBeDeleted
: Gives the amount of assets that are meant to be deleted after diffing the local and remote stateassetWritten
: The record name of each asset written to diskalbumsToBeAdded
: Gives the amount of albums that are meant to be added after diffing the local and remote statealbumsToBeKept
: Gives the amount of albums that are meant to be kept after diffing the local and remote statealbumsToBeDeleted
: Gives the amount of albums that are meant to be deleted after diffing the local and remote stateerrors
: Gives each error message recorded during operationwarnings
: Gives each warning message recorded during operation