-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
all: Add Prometheus-style metrics to expose some internal performance counters (fixes #5175) #9003
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
Conversation
* main: (27 commits) gui, man, authors: Update docs, translations, and contributors cmd/syncthing: Mention STVERSIONEXTRA in --help output (ref syncthing#8980) gui, lib/api: Add possibility to feed through extra version information (syncthing#8980) cmd/ursrv: Update map tile URL cmd/strelaypoolsrv: Update map tile URL (syncthing#8985) cmd/stcrashreceiver: Correct parsing of current version string build: Update dependencies cmd/ursrv: Remove old, unused user movement code cmd/ursrv: Merge ursrv and uraggregate as subcommands cmd/ursrv: Remove useless static TLS cert handling cmd/ursrv: Embed static assets cmd/ursrv: Refactor to use CLI options, fewer global vars gui: Show xattr filter editor when send xattrs checked (fixes syncthing#8958) (syncthing#8959) gui, man, authors: Update docs, translations, and contributors build: Build Docker image for plain 32 bit arm (fixes syncthing#8973) lib/fs: Clarify errors for Windows filenames (fixes syncthing#8968) (syncthing#8969) gui: Avoid spurious comma in shared-with device list (fixes syncthing#8967) (syncthing#8970) cmd/ursrv: Summarize tiny fraction items into Other cmd/ursrv: Update distributions list build: Only push releases to cloud storage, and also use `latest` ...
* main: gui: Remove Twitter link from footer (syncthing#9000) gui, man, authors: Update docs, translations, and contributors lib/ur: Don't report uptime if start time is in the past (fixes syncthing#7698) (syncthing#8996) lib/model: use WARN for "Unexpected folder" messages (syncthing#8998) lib/osutil: Skip setLowPriority in Windows if already lower (fixes syncthing#6597) (syncthing#8993) all: replace empty slice literal with `var` (syncthing#8990) all: fix unused method receiver (syncthing#8988) all: unused parameter should be replaced by underscore (syncthing#8989)
|
Can't say much about the utility or implementation here. Just a reminder to please update the API docs as well if this gets added. |
|
A status info would also great for a Main Grafana Page of a Server where your can easy see if all thinks works. |
* main: build: Increase Go version to 1.20.7 lib/config: Allow sharing already encrypted folder with untrusted devices (fixes syncthing#8965) (syncthing#9012) gui: Use case-insensive and backslash-agnostic versions filter (fixes syncthing#7973) (syncthing#8995) gui, man, authors: Update docs, translations, and contributors build: Run govulncheck (fixes syncthing#8983) build: Run build & tests on main branch nightly build: Send test logs to Grafana Loki for statistics all: Refactor the protocol/model interface a bit (ref syncthing#8981) (syncthing#9007) lib/connections: Fix building with `-tags noquic` (syncthing#9009) gui: Fix tooltips on buttons inside button groups (ref syncthing#7984) (syncthing#9008) cmd/strelaysrv: Handle accept error with debug set (fixes syncthing#9001) (syncthing#9004) lib/api: Fix data race in TestCSRFRequired (syncthing#9006) gui: Show full error for failed items (syncthing#9005) lib/api: Allow `Bearer` authentication style with API key (syncthing#9002)
|
@acolomb I added a script to find all metrics definitions in the source code and generate a markdown list. The intention is to use this in the docs repo in some script to make sure we have an up to date list of all metrics as they get added or removed over time. Sample output: Package
|
er-pa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no objections, looks good to me code-wise
|
@calmh Do you have some integration for your script ready for the docs repo yet? Just nagging so we don't let the API docs get out of sync again so quickly. |
* main: gui, man, authors: Update docs, translations, and contributors all: Add Prometheus-style metrics to expose some internal performance counters (fixes syncthing#5175) (syncthing#9003) build: Increase Go version to 1.20.7 lib/config: Allow sharing already encrypted folder with untrusted devices (fixes syncthing#8965) (syncthing#9012) gui: Use case-insensive and backslash-agnostic versions filter (fixes syncthing#7973) (syncthing#8995) gui, man, authors: Update docs, translations, and contributors build: Run govulncheck (fixes syncthing#8983) build: Run build & tests on main branch nightly build: Send test logs to Grafana Loki for statistics
This adds a
/metricsendpoint on the REST API which exposes a number of performance counters. The purpose is to allow better monitoring of a Syncthing instance, using standard tooling such as Prometheus and Grafana. The metrics endpoint lives behind the same authentication (or lack thereof) configured on the rest of the API. For the avoidance of doubt, this data is just made available for consumption by the user or administrator -- it is not sent as part of the usage report or otherwise communicated to outside observers.I have added a basic set of metrics that I'm interested in; this could and should be added to in the future as needs arise. Currently it can answer questions such as how much data is transferred to/from each device, with which compression ratio; how much data and how many files are in each folder; how much time is spent pulling or scanning, and how much data is pulled (from where) or scanned; how many filesystem operations do we performance and what's the average time for each such operation; how much data is read or written to the filesystem; how many events of each type are created. Additionally, some Go internals (memory, GC, goroutines, etc) are exposed by default by the Prometheus library.
There are many more things that could be tracked, including things mentioned in the original ticket but not implemented here. I don't want to make an exhaustive attempt, rather keep this one contained and reasonable and let actual needs dictate further additions.
Sample dashboards, somewhat boring from my rather idle home setup:
Here is an example of what the current data can look like: