Metrics and core/stats are not showing any files transferred

Hi,
In my Google Cloud shell I have installed and config rclone. See below
rclone v1.67.0

  • os/version: ubuntu 22.04 (64 bit)
  • os/kernel: 6.1.85+ (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.22.4
  • go/linking: static
  • go/tags: none

Once config done. I ran below command to enable prometheus metrics on /metrics
rclone rcd --rc-addr localhost:5572 --rc-enable-metrics &

then I used below commands to copy and delete files in gcs bucket using rclone
cloudshell:~/metrics/new_rc/rclone-v1.67.0-linux-amd64 (project)$ rclone -v delete gcp:bucket1/employees.csv
2024/07/16 09:50:51 INFO : employees.csv: Deleted
@cloudshell:~/metrics/new_rc/rclone-v1.67.0-linux-amd64 (project)$ rclone -v copy gcp:bucket2 gcp:bucket1
2024/07/16 09:51:21 INFO : employees.csv: Copied (server-side copy)
2024/07/16 09:51:21 INFO :
Transferred: 33.531 KiB / 33.531 KiB, 100%, 0 B/s, ETA -
Checks: 2 / 2, 100%
Transferred: 1 / 1, 100%
Server Side Copies: 1 @ 33.531 KiB
Elapsed time: 1.5s

Using both curl and core/stats I am getting file metrics as 0

cloudshell:~/metrics/new_rc/rclone-v1.67.0-linux-amd64 (agbg-sandbox)$ rclone rc core/stats
{
"bytes": 0,
"checks": 0,
"deletedDirs": 0,
"deletes": 0,
"elapsedTime": 10233.773589261,
"errors": 0,
"eta": null,
"fatalError": false,
"renames": 0,
"retryError": false,
"serverSideCopies": 0,
"serverSideCopyBytes": 0,
"serverSideMoveBytes": 0,
"serverSideMoves": 0,
"speed": 0,
"totalBytes": 0,
"totalChecks": 0,
"totalTransfers": 0,
"transferTime": 0,
"transfers": 0
}

using curl http://localhost:5572/metrics below are zero

HELP rclone_files_deleted_total Total number of files deleted

TYPE rclone_files_deleted_total counter

rclone_files_deleted_total 0

HELP rclone_files_deleted_total Total number of files deleted

TYPE rclone_files_deleted_total counter

rclone_files_deleted_total 0

HELP rclone_files_transferred_total Number of transferred files

TYPE rclone_files_transferred_total counter

rclone_files_transferred_total 0

For which I should be getting metrics/stats data. Please help with this.

Your rclone commands aren't running through the rclone rcd you started - that is why they aren't showing any metrics.

You need to do rclone rc commands to run the commands through the rclone rcd

rclone rc operations/copy ...

See operations/copy

I am passing --rc-no-auth flag still getting below error

cloudshell:~/metrics/new_rc/rclone-v1.67.0-linux-amd64 (project)$ rclone rc --rc-no-auth operations/copyfile srcFs=gcp:gcsbucket1 dstFs=gcp:gcsbucket2
2024/07/16 10:52:20 ERROR : rc: "operations/copyfile": error: authentication must be set up on the rc server to use "operations/copyfile" or the --rc-no-auth flag must be in use
{
"error": "authentication must be set up on the rc server to use "operations/copyfile" or the --rc-no-auth flag must be in use",
"input": {
"dstFs": "gcp:gcsbucket2",
"srcFs": "gcp:gcsbucket1"
},
"path": "operations/copyfile",
"status": 403
}
2024/07/16 10:52:20 Failed to rc: operation "operations/copyfile" failed: authentication must be set up on the rc server to use "operations/copyfile" or the --rc-no-auth flag must be in use

You have to put the --rc-no-auth flag on the rclone rcd call to say that you don't care to use authentication.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.