-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[client] Feature/client metrics #5512
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
58 commits
Select commit
Hold shift + click to select a range
c5eb5ba
Add client metrics
pappz e3a5c44
Add client metrics system with OpenTelemetry and VictoriaMetrics support
pappz bb377a2
Merge main branch into feature/client-metrics
pappz 5f02a48
Merge branch 'main' into feature/client-metrics
pappz 5169129
Add signaling metrics tracking for initial and reconnection attempts
pappz cbfde79
Reset connection stage timestamps during reconnections to exclude unn…
pappz 08295e5
Delete otel lib from client
pappz e7283a8
Update unit tests
pappz 138e728
Invoke callback on handshake success in WireGuard watcher
pappz 80abddb
Merge branch 'main' into feature/client-metrics
pappz ca3e6d9
Add Netbird version tracking to client metrics
pappz bec58b8
Add sync duration tracking to client metrics
pappz 3753bf7
Remove no-op metrics implementation and simplify ClientMetrics constr…
pappz 7e276a4
Add total duration tracking for connection attempts
pappz cf0a1fa
Add metrics push support to VictoriaMetrics integration
pappz 75a5955
Merge branch 'main' into feature/client-metrics-push
pappz 8ed99ba
[client] anchor connection metrics to first signal received
pappz dfdff69
Merge branch 'main' into feature/client-metrics-push
pappz 8a852d4
Remove creation_to_semaphore connection stage metric
pappz 473f59c
[client] Add remote push config for metrics with version-based eligib…
pappz ee13016
[client] Add WASM-compatible NewClientMetrics implementation
pappz eb1a9b1
Add missing file
pappz f2ef0c4
Update default case in DeploymentType.String to return "unknown" inst…
pappz e585064
[client] Rework metrics to use timestamped samples instead of histograms
pappz 5a018c1
[client] Add InfluxDB metrics backend alongside VictoriaMetrics
pappz 4aeab69
[client] Fix metrics issues and update dev docker setup
pappz 80543b5
[client] Add anonymised peer tracking to pushed metrics
pappz b577289
Remove unused dependencies from go.mod and go.sum
pappz 4698490
Refactor InfluxDB ingest pipeline: extract validation logic
pappz 1d5224b
Set non-root user in Dockerfile for Ingest service
pappz 15f12c8
Fix Windows CI: command line too long
pappz ddaaa92
Remove Victoria metrics
pappz d4c80ef
Add hashed peer ID as Authorization header in metrics push
pappz ebfd984
Revert influxdb in docker compose
pappz da63e2f
Enable gzip compression and authorization validation for metrics push…
pappz 5815fac
Reducate code of complexity
pappz 1dd2b9b
Update debug documentation to include metrics.txt description
pappz f6353c3
Increase `maxBodySize` limit to 50 MB and update gzip reader wrapping…
pappz d8118df
Refactor deployment type detection to use URL parsing for improved ac…
pappz d78f05d
Update readme
pappz 3625b3b
Throttle remote config retries on fetch failure
pappz e24c0bb
Preserve first WG handshake timestamp, ignore rekeys
pappz 804cd5d
Skip adding empty metrics.txt to debug bundle in debug mode
pappz b4cd717
Update default metrics server URL to https://ingest.netbird.io
pappz d272755
Atomic metrics export-and-reset to prevent sample loss between Export…
pappz 21ffd87
Fix doc
pappz 9df13ba
Refactor Push configuration to improve clarity and enforce minimum pu…
pappz 1085ad0
Remove `minPushInterval` and update push interval validation logic
pappz 44edbfd
Revert ExportAndReset, it is acceptable data loss
pappz 20d0569
Fix metrics review issues: rename env var, remove stale infra, add tests
lixmal d4be42b
Add login duration metric, ingest tag validation, and duration bounds
lixmal 672fc66
Add arch tag to all metrics
lixmal c44b797
Fix Grafana dashboard: add arch to drop columns, add login panels
lixmal efa2ec9
Merge remote-tracking branch 'origin/main' into feature/client-metric…
lixmal e67ae9a
Validate NB_METRICS_SERVER_URL is an absolute HTTP(S) URL
lixmal 59f8c5d
Address review comments: fix README wording, update stale comments
lixmal 8a761cc
Clarify env var precedence does not bypass remote config eligibility
lixmal 909445d
Remove accidentally committed pprof files
lixmal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| package metrics | ||
|
|
||
| // ConnectionType represents the type of peer connection | ||
| type ConnectionType string | ||
|
|
||
| const ( | ||
| // ConnectionTypeICE represents a direct peer-to-peer connection using ICE | ||
| ConnectionTypeICE ConnectionType = "ice" | ||
|
|
||
| // ConnectionTypeRelay represents a relayed connection | ||
| ConnectionTypeRelay ConnectionType = "relay" | ||
| ) | ||
|
|
||
| // String returns the string representation of the connection type | ||
| func (c ConnectionType) String() string { | ||
| return string(c) | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| package metrics | ||
|
|
||
| import ( | ||
| "net/url" | ||
| "strings" | ||
| ) | ||
|
|
||
| // DeploymentType represents the type of NetBird deployment | ||
| type DeploymentType int | ||
|
|
||
| const ( | ||
| // DeploymentTypeUnknown represents an unknown or uninitialized deployment type | ||
| DeploymentTypeUnknown DeploymentType = iota | ||
|
|
||
| // DeploymentTypeCloud represents a cloud-hosted NetBird deployment | ||
| DeploymentTypeCloud | ||
|
|
||
| // DeploymentTypeSelfHosted represents a self-hosted NetBird deployment | ||
| DeploymentTypeSelfHosted | ||
| ) | ||
|
|
||
| // String returns the string representation of the deployment type | ||
| func (d DeploymentType) String() string { | ||
| switch d { | ||
| case DeploymentTypeCloud: | ||
| return "cloud" | ||
| case DeploymentTypeSelfHosted: | ||
| return "selfhosted" | ||
| default: | ||
| return "unknown" | ||
| } | ||
| } | ||
|
|
||
| // DetermineDeploymentType determines if the deployment is cloud or self-hosted | ||
| // based on the management URL string | ||
| func DetermineDeploymentType(managementURL string) DeploymentType { | ||
| if managementURL == "" { | ||
| return DeploymentTypeUnknown | ||
| } | ||
|
|
||
| u, err := url.Parse(managementURL) | ||
| if err != nil { | ||
| return DeploymentTypeSelfHosted | ||
| } | ||
|
|
||
| if strings.ToLower(u.Hostname()) == "api.netbird.io" { | ||
| return DeploymentTypeCloud | ||
| } | ||
|
|
||
| return DeploymentTypeSelfHosted | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.