Skip to content

Commit d16e6d1

Browse files
committed
chore: update list of metrics
Signed-off-by: Jakob Borg <jakob@kastelo.net>
1 parent c5f0811 commit d16e6d1

2 files changed

Lines changed: 59 additions & 3 deletions

File tree

_script/find-metrics/find-metrics.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,19 @@ func main() {
4949
log.Fatalln(err)
5050
}
5151

52+
validPkgPrefixes := []string{
53+
"github.com/syncthing/syncthing/internal/",
54+
"github.com/syncthing/syncthing/lib/",
55+
}
56+
5257
var coll metricCollector
5358
for _, pkg := range pkgs {
54-
for _, file := range pkg.Syntax {
55-
ast.Inspect(file, coll.Visit)
59+
for _, pref := range validPkgPrefixes {
60+
if strings.HasPrefix(pkg.PkgPath, pref) {
61+
for _, file := range pkg.Syntax {
62+
ast.Inspect(file, coll.Visit)
63+
}
64+
}
5665
}
5766
}
5867
coll.print()

includes/metrics-list.rst

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,45 @@
1+
Package *build*
2+
~~~~~~~~~~~~~~~
3+
4+
Metric *syncthing_build_info* (gauge vector)
5+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
7+
A metric with a constant '1' value labeled by version information from
8+
when the binary was built.
9+
10+
Package *connections*
11+
~~~~~~~~~~~~~~~~~~~~~
12+
13+
Metric *syncthing_connections_active* (gauge vector)
14+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15+
16+
Number of currently active connections, per device. If value is 0, the
17+
device is disconnected.
18+
19+
Package *db*
20+
~~~~~~~~~~~~
21+
22+
Metric *syncthing_db_files_updated_total* (counter vector)
23+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
24+
25+
Total number of files updated.
26+
27+
Metric *syncthing_db_operation_seconds_total* (counter vector)
28+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
29+
30+
Total time spent in database operations, per folder and operation.
31+
32+
Metric *syncthing_db_operations_current* (gauge vector)
33+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
34+
35+
Number of database operations currently ongoing, per folder and
36+
operation.
37+
38+
Metric *syncthing_db_operations_total* (counter vector)
39+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
40+
41+
Total number of database operations, per folder and operation.
42+
143
Package *events*
244
~~~~~~~~~~~~~~~~
345

@@ -30,11 +72,16 @@ operation.
3072
Package *model*
3173
~~~~~~~~~~~~~~~
3274

75+
Metric *syncthing_model_folder_conflicts_total* (counter vector)
76+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
77+
78+
Total number of conflicts.
79+
3380
Metric *syncthing_model_folder_processed_bytes_total* (counter vector)
3481
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3582

3683
Total amount of data processed during folder syncing, per folder ID and
37-
data source (network/local_origin/local_other/local_shifted/skipped).
84+
data source (network/local_origin/local_other/skipped).
3885

3986
Metric *syncthing_model_folder_pull_seconds_total* (counter vector)
4087
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)