syncthing/lib/connections
DerRockWolf debbe726e0
lib/connections: Add syncthing_connections_active metric (fixes #9527) (#9528)
### Purpose

Adds a new metric `syncthing_connections_active` which equals to the
amount of active connections per device.

Fixes #9527 

<!--
Describe the purpose of this change. If there is an existing issue that
is
resolved by this pull request, ensure that the commit subject is on the
form
`Some short description (fixes #1234)` where 1234 is the issue number.
-->

### Testing

I've manually tested it by running syncthing with these changes locally
and examining the returned metrics from `/metrics`.
I've done the following things:
- Connect & disconnect a device
- Increase & decrease the number of connections and verify that the
value of the metric matches with the amount displayed in the GUI.

### Documentation

https://github.com/syncthing/docs/blob/main/includes/metrics-list.rst
needs to be regenerated with
[find-metrics.go](https://github.com/syncthing/docs/blob/main/_script/find-metrics/find-metrics.go)

## Authorship

Your name and email will be added automatically to the AUTHORS file
based on the commit metadata.

---------

Co-authored-by: Jakob Borg <jakob@kastelo.net>
2024-05-04 22:31:37 +02:00
..
mocks lib: Use counterfeiter to mock interfaces in tests (#7375) 2021-03-03 08:53:50 +01:00
registry all: Support multiple device connections (fixes #141) (#8918) 2023-09-06 12:52:01 +02:00
connections_test.go all: Correct various typos (#8870) 2023-05-09 08:54:02 +02:00
debug.go all, lib/logger: Refactor SetDebug calls (#6054) 2019-10-04 13:03:34 +02:00
deprecated.go lib/connections: Handle QUIC not being available (#7186) 2020-12-09 19:23:50 +01:00
dialqueue_test.go all: Fix various user-facing and non-user-facing typos (#8509) 2022-08-23 15:44:11 +02:00
dialqueue.go lib/config, lib/connections: Add optional connection limits (fixes #7176) (#7223) 2021-01-11 15:14:44 +01:00
lan_test.go lib/config, lib/connections: Configurable protocol priority (ref #8626) (#8868) 2023-04-16 14:54:28 +02:00
limiter_test.go all: Use new Go 1.19 atomic types (#8772) 2023-02-07 12:07:34 +01:00
limiter.go all: Use new Go 1.19 atomic types (#8772) 2023-02-07 12:07:34 +01:00
metrics.go lib/connections: Add syncthing_connections_active metric (fixes #9527) (#9528) 2024-05-04 22:31:37 +02:00
quic_dial.go all: Support multiple device connections (fixes #141) (#8918) 2023-09-06 12:52:01 +02:00
quic_listen.go build: Use Go 1.22, minimum is Go 1.21 (#9408) 2024-02-09 16:35:29 +01:00
quic_misc.go build: Use Go 1.22, minimum is Go 1.21 (#9408) 2024-02-09 16:35:29 +01:00
quic_unsupported.go build: Use Go 1.22, minimum is Go 1.21 (#9408) 2024-02-09 16:35:29 +01:00
relay_dial.go all: unused parameter should be replaced by underscore (#8989) 2023-07-18 14:33:13 +00:00
relay_listen.go lib/config, lib/connections: Configurable protocol priority (ref #8626) (#8868) 2023-04-16 14:54:28 +02:00
service.go lib/connections: Add syncthing_connections_active metric (fixes #9527) (#9528) 2024-05-04 22:31:37 +02:00
structs.go lib/connections: Fix transport type detection for QUIC (fixes #8274) (#9114) 2023-09-20 11:23:48 +02:00
tcp_dial.go all: Support multiple device connections (fixes #141) (#8918) 2023-09-06 12:52:01 +02:00
tcp_listen.go lib/nat, lib/upnp: IPv6 UPnP support (#9010) 2023-12-11 07:36:18 +01:00
util.go lib/connections: Skip allocation in check for missing port (#9297) 2023-12-20 11:59:11 +01:00