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_STARTEDAUTHENTICATEDMFA_REQUIREDMFA_RECEIVEDDEVICE_TRUSTEDACCOUNT_READYICLOUD_READYSYNC_STARTFETCH_N_LOAD_STARTEDFETCH_N_LOAD_COMPLETEDDIFF_STARTEDDIFF_COMPLETEDWRITE_STARTEDWRITE_ASSETS_STARTEDWRITE_ASSETS_COMPLETEDWRITE_ALBUMS_STARTEDWRITE_ALBUMS_COMPLETEDWRITE_COMPLETEDSYNC_COMPLETEDSYNC_RETRYERROR
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
