Prometheus metrics

I'd like to add more observability to underlying cloud providers' SDKs by adding prometheus metrics.
I'm mostly concerned with monitoring non standard responses, errors and retries.

My initial idea is by adding that functionality to fshttp::Transport

With promhttp package, more or less like in the example (without trace)

The static labels would be

  • fs name
  • HTTP host

I'd appreciate feedback regarding this idea and possible improvements to this design draft.

There is an issue about this

it looks like it has stalled - maybe you'd like to take it over?

Adding observability to the rclone Transport is a good way of capturing all the backends so that sounds like a great idea.

Where would you get fs name from? It is possible that the Transport is in use by two backends at once, eg if you are copying from s3 to google drive...

The issue is related but not the same. In the issue they want accounting data as metrics. Here I want what is currently darkness to become light.

We should have /metrics endpoint in the server this is a standard prometheus way of doing things.

FS name can be passed in constructor to fshttp but on the other hand it's not mandatory and not passing it would make the patch smaller.

Agreed, not the same but similar!

OK, happy to take your lead here.

OK, if you think it would be useful enough without then let's go for that.

Hello,

is it possible to import rclone mount stats via /metrics in prometheus?
edit: works with mount... thanks

is it possible to see the icoming and outgoing traffic/files seperated?

I don't think so at the moment.

thanks for the fast reply.
would be nice to have this... can I add a feature request?

Rclone doesn't measure this at the moment, though with the planned changes to the bandwidth limiters it would fit in there.

By all means make an issue!

Are there any screenshots of what those metrics are? I'm curious

It is basically the same info that you can get from the core/stats rc call.

Hi
I was also going with the same issue for underlying cloud SDK by adding prometheus metrics. After reading and implementing this thread I solved my issue. Also I was curious about the metrics.
Thank you.

@zaimd have you got some pics of the dashboard you could share?

The metrics are almost perfect. It would be a killer feature to have Operations reporting there as well (Copied, Deleted, Transfered) file names, error reporting etc.

Logs (stdout and Json) already provide that info. How hard would it be to integrate that to the /metrics endpoint?

Probably not terribly hard!

The log/console output and prometheus metrics are all based of the stats.

Fancy having a go and sending a PR @rafaelreisr ?