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)
- 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
- Better handling when auto-accepting syncs of preexisting folders HOT 6
- unsync files included ignore pattern when adding a new one
- Why can't see the progress in upgrade HOT 2
- Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. The name in the certificate does not match the expected. Could not handshake: Error in the certificate verification. [IP: 0.0.0.0 443] HOT 2
- Customized temporary file directory, unified storage of temporary files during the synchronization process HOT 2
- Provide advanced parameter configuration: Disable copying blocks from other folders on the device HOT 2
- Shutdown switch in header instead of language selector HOT 2
- Last version breaks syncthing on MacOS Mojave (10.14.6) HOT 1
- I need help / Firewall and ports / ips HOT 1
- Trashcan max size option
- Ignore specific folder to sync deletion HOT 5
- Deleting/moving directory on Android causes error: folder marker missing (this indicates potential data loss, search docs
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.