Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up Metrics #838

Open
cahfofpai opened this issue Feb 4, 2025 · 4 comments
Open

Set up Metrics #838

cahfofpai opened this issue Feb 4, 2025 · 4 comments

Comments

@cahfofpai
Copy link

It would be very interesting to have metrics for the Transitous instance of Motis:

  • how many API requests per day / per month / until now
  • when are peeks in the amount of requests
  • maximum number of parallel requests
  • which service is the request for (routing, geocoding, ...)
  • what is the usage of the system resources (cpu, ram, disk, bandwidth)

For example Grafana could be used for building a dashboard and Prometheus for collecting the data.

The request based matrics could be derived from the server logs:

For the system resources there are other exporters:

Maybe I could try to implement this myself.

What do you think about this?

@cahfofpai cahfofpai changed the title Metrics Set up Metrics Feb 4, 2025
@mlundblad
Copy link
Collaborator

I don't know if usear agent might also be useful to see the usage per app.

Not sure if other apps sets User-Agent to something specific (GNOME Maps sets "gnome-maps/" in the User-Agent header).

@cahfofpai
Copy link
Author

I don't know if usear agent might also be useful to see the usage per app.

Not sure if other apps sets User-Agent to something specific (GNOME Maps sets "gnome-maps/" in the User-Agent header).

I also already had the idea for metrics per app, but left it for future improvements because it would need support by the clients. I thought about a separate URL parameter or similar with the app id, but the user agent would also be a possibility.

A topic to research for web clients would be whether they can set a different user agent for their requests, as normally it is set by the browser (also see https://stackoverflow.com/a/71172812).

@jbruechert
Copy link
Collaborator

jbruechert commented Feb 4, 2025

I agree this would be cool to have. I think Spline already has a Garafana instance that we could probably use.
For the actual setup to collect the statistics I would welcome contributions as I personally don't want to increase the portion of my time going to sysadmin-style stuff in this project :)

(I can of course help when access to the server is necessary)

@traines-source
Copy link
Member

Number of queries etc are intended to be directly included into MOTIS as Prometheus metrics, see here: motis-project/motis#696
Not sure if as soon as this is implemented, web server metrics are still that relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants