Repository navigation
feat(lib/connections): add name label to syncthing_connections_active metric - #10147
Closed
DerRockWolf wants to merge 1 commit into
Closed
DerRockWolf wants to merge 1 commit into
DerRockWolf wants to merge 1 commit into
Conversation
Member
|
This has come up a couple of times, there was another PR that started to address it. I have a particular opinion on how I think it should be done, so I did it now: I think this should cover your case as well? |
Contributor
Author
That solves it really nicely and way better than adding all labels to every metric 😍 |
cre4ture
added a commit
to cre4ture/thingium
that referenced
this pull request
Jul 5, 2025
* fix(protocol): avoid deadlock with concurrent connection start and close (syncthing#10140) * build: properly propagate build tags to Debian build (syncthing#10144) Previously all were ignored except noupgrade which was hard coded... * chore(protocol): don't start connection routines a second time (syncthing#10146) * chore(protocol): only allow enc. password changes on cluster config (syncthing#10145) In practice we already always call SetPassword and ClusterConfig together. However it's not just "sensible" to do that, it's required: If the passwords change, the remote device needs to know about that to check that the enc. setup is valid/consistent (e.g. tokens match, folder-type is appropriate, ...). And with the passwords set later, there's no point in adding them as part of creating a new connection. This is a "followup" (if one can call it that 4 years later :) ) to resp. fix for the following commit: 924b968 Co-authored-by: Jakob Borg <[email protected]> * build: remove schedule from PR metadata job It shouldn't have touched non-PR issues, but it did * chore: add issue types to GitHub issue templates * feat(config): expose folder and device info as metrics (fixes syncthing#9519) (syncthing#10148) Tihs makes it easier to use metrics based on device and folder labels, names, and other attributes. Other metrics which are based on folder or device ID can be joined with these info metrics to enrich their label sets. ``` # HELP syncthing_config_device_info Provides additional information labels on devices # TYPE syncthing_config_device_info gauge syncthing_config_device_info{device="I6KAH76-66SLLLB-5PFXSOA-UFJCDZC-YAOMLEK-CP2GB32-BV5RQST-3PSROAU",introducer="false",name="s1",paused="false",untrusted="false"} 1 # HELP syncthing_config_folder_info Provides additional information labels on folders # TYPE syncthing_config_folder_info gauge syncthing_config_folder_info{folder="default",label="The default folder",path="s2",paused="false",type="sendreceive"} 1 ``` With this you can e.g. query for ``` syncthing_connections_active * on(device) group_left syncthing_config_device_info ``` Fixes syncthing#9519 Closes syncthing#10074 Closes syncthing#10147 * chore(gui, man, authors): update docs, translations, and contributors * build: use own script instead of svu We use a slightly different handling of features between prereleases. * build: include "v" prefix in version tags... * chore: copyright in next-version script * fix(syncthing): avoid writing panic log to nil fd (syncthing#10154) ### Purpose This change fixes a logical bug in the panic log writing where we could end up writing to a uninitialized file descriptor. On the very first iteration, `panicFd` is nil. We enter the if `panicFd == nil { … }` block, check for “panic:” or “fatal error:”, and if neither matches, we skip instantiating `panicFd` altogether. However, immediately after, still within `if panicFd == nil { … }`, we call `panicFd.WriteString("Panic at ...")`. But `panicFd` would in this case be `nil`, which will cause a run‐time panic. It's not clear to me why panicFd is only initialized if the lines start with "panic:" or "fatal error:" so I've left that logic untouched. With this change we at least avoid the risk of writing to a nil filedescriptor. ## Authorship Your name and email will be added automatically to the AUTHORS file based on the commit metadata. --------- Co-authored-by: Jakob Borg <[email protected]> * fix(stupgrades): return latest stable & pre for each major * build: also create relaysrv and discosrv releases * docs: link to Docker image, APT, in release notes * build: more resilient pushes to releases * fix(watchaggregator): properly handle sub-second watch durations (fixes syncthing#9927) (syncthing#10179) I'll let Audrius words from the ticket explain this :) > I'm a bit lost, time.Duration is an int64, yet watcher delay is float, > anything sub 1s gets rounded down to 0, so you just end up going into an > infinite loop. syncthing#9927 (comment) * fix(protocol): slightly loosen/correct ownership comparison criteria (fixes syncthing#9879) (syncthing#10176) Only Require either matching UID & GID OR matching Names. If the 2 devices have a different Name => UID mapping, they can never be totaly equal. Therefore when syncing we try matching the Name and fall back to the UID. However when scanning for changes we currently require both the Name & UID to match. This leads to forever having out of sync files back and forth, or local additions when receive only. This patch does not change the sending behavoir. It only change what we decide is equal for exisiting files with mismapped Name => UID, The added testcases show the change: Test 1,5,6 are the same as current. Test 2,3 Are what change with this patch (from false to true). Test 4 is a subset of test 2 they is currently special cased as true, which does not chnage. Co-authored-by: Jakob Borg <[email protected]> * build: import release workflow changes from main * build: fix detection of next rc version --------- Co-authored-by: Jakob Borg <[email protected]> Co-authored-by: Simon Frei <[email protected]> Co-authored-by: Syncthing Release Automation <[email protected]> Co-authored-by: ardevd <[email protected]> Co-authored-by: yparitcher <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Adds a
namelabel with the device name to thesyncthing_connections_activemetric.Testing
Tested locally:
Documentation
Metrics docs need to be regenerated.
Authorship
Your name and email will be added automatically to the AUTHORS file
based on the commit metadata.