Comments (8)
I agree, but a single device can have an arbitrary number of active connections nowadays. So, what you're proposing, but 1
can also become 3
or 28
.
syncthing_protocol_connections_active{device="DEVICE-A"} 28 # connected, large number of concurrent data connections
syncthing_protocol_connections_active{device="DEVICE-b"} 0 # disconnected
from syncthing.
I agree, but a single device can have an arbitrary number of active connections nowadays. So, what you're proposing, but
1
can also become3
or28
.syncthing_protocol_connections_active{device="DEVICE-A"} 28 # connected, large number of concurrent data connections syncthing_protocol_connections_active{device="DEVICE-b"} 0 # disconnected
Got it, thanks for clarifying.
I'll try to implement it and open a PR 🙂
from syncthing.
I think the accounting functions you found are a good place. There's probably some map or slice there that has the number of connections you can get the length of, or just pair the inc/dec as you say.
from syncthing.
Sounds reasonable. I'd probably make it a gauge on the number of connections, so zero is disconnected and then positive numbers for connected devices.
from syncthing.
Sounds reasonable. I'd probably make it a gauge on the number of connections, so zero is disconnected and then positive numbers for connected devices.
Oh, then I probably didn't phrase it good enough 😅
My plan was to do it specific to the device ID, e.g.,
# specific device connected:
syncthing_protocol_connection_state{device="DEVICE-A"} 1
# specific device not connected:
syncthing_protocol_connection_state{device="DEVICE-B"} 0
from syncthing.
After looking around a bit I found connections.accountAddedConnection
& connections.accountRemovedConnection
as functions where I can add the Inc
& Dec
calls. The connections
package currently doesn't have its own metrics.go
, so I would add one.
I however don't know if this is the best location. I've also found protocol.NewConnection
& protocol.internalClose
and model.AddConnection
& model.Closed
.
It would be great if you could point me to the location you would consider to be suitable.
from syncthing.
So (if I may) how does one use this new functionality? I am not even clear whether the new feature is GUI or CLI.
from syncthing.
So (if I may) how does one use this new functionality? I am not even clear whether the new feature is GUI or CLI.
Syncthing exposes a bunch of metrics on .../metrics
(e.g. 127.0.0.1:8384/metrics
) which can be handled by some prometheus instance or alike. And this change simply exposes one more metric there.
https://docs.syncthing.net/users/metrics.html
from syncthing.
Related Issues (20)
- LDAP - can't login if domain controller password is needed
- Expand Prometheus Metrics to state device/folder names HOT 5
- meta.js is sent with the wrong MIME type HOT 6
- add exit on sync or execute on sync
- Connect devices with XMPP (and also Ad-Hoc commands!) HOT 6
- Data is too short, but why? HOT 4
- Add local sync mode HOT 1
- Interface without JS (HTML and Gemini) HOT 1
- Creation date gone after sync HOT 1
- Include an option in the GUI to run Syncthing on startup HOT 1
- Sync reserved characters proposal HOT 17
- syncOwnership skip parent folders of an included file HOT 2
- Integration tests fail HOT 2
- About Synology's fucking shit @eaDir and Thumbs.db caused problem HOT 1
- 同步失败 HOT 1
- Wrong Identification after Startup HOT 1
- Received an error while running --reset-database. HOT 1
- Make it possible to prefer UID/GID over usernames when syncing permissions HOT 3
- WebUI randomly refreshes without being prompted to HOT 14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from syncthing.