[PR #5486] [MERGED] [management] aggregate grpc metrics by accountID #28028

Closed
opened 2026-08-05 07:09:34 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/5486
Author: @pascal-fischer
Created: 3/2/2026
Status: Merged
Merged: 3/5/2026
Merged by: @pascal-fischer

Base: mainHead: feature/aggregate-grpc-metrics


📝 Commits (8)

📊 Changes

3 files changed (+505 additions, -26 deletions)

View changed files

management/server/telemetry/account_aggregator.go (+185 -0)
management/server/telemetry/account_aggregator_test.go (+219 -0)
📝 management/server/telemetry/grpc_metrics.go (+101 -26)

📄 Description

Describe your changes

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

Documentation

Select exactly one:

  • I added/updated documentation for this change
  • Documentation is not needed for this change (explain why)

Docs PR URL (required if "docs added" is checked)

Paste the PR link from https://github.com/netbirdio/docs here:

https://github.com/netbirdio/docs/pull/__

Summary by CodeRabbit

  • New Features
    • Per-account P95 latency metrics for sync requests.
    • Per-account P95 latency metrics for login requests.
    • Lightweight per-account duration aggregator that records durations and computes P95 values.
    • Background flushers that periodically publish per-account P95s to metrics.
    • Graceful shutdown support for the new telemetry components.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbirdio/netbird/pull/5486 **Author:** [@pascal-fischer](https://github.com/pascal-fischer) **Created:** 3/2/2026 **Status:** ✅ Merged **Merged:** 3/5/2026 **Merged by:** [@pascal-fischer](https://github.com/pascal-fischer) **Base:** `main` ← **Head:** `feature/aggregate-grpc-metrics` --- ### 📝 Commits (8) - [`f09d40f`](https://github.com/netbirdio/netbird/commit/f09d40fb9bdfbd5fbd5c2bc84fadd1214468d1ec) aggregate grpc metrics by accountID - [`912cdc1`](https://github.com/netbirdio/netbird/commit/912cdc1cd7cd71718074340096cbdc2772ec85ca) reduce complexity - [`b00ea7c`](https://github.com/netbirdio/netbird/commit/b00ea7cb5b64258e0297a9c4e2d7ab9dc95d1010) fix counting - [`804a23f`](https://github.com/netbirdio/netbird/commit/804a23f810abb2124145639a1fa1e2801eaac290) use DeltaTemporality - [`22da7bd`](https://github.com/netbirdio/netbird/commit/22da7bd35602b7b0079e92cf00a9e5eb721893ed) fix cleaning up stale accounts - [`5f4c9ae`](https://github.com/netbirdio/netbird/commit/5f4c9ae784f9d619becc6615c3f91b941570e857) add aggregator tests - [`0e89101`](https://github.com/netbirdio/netbird/commit/0e89101b97a801168662e8d8bb4bdda30734efd0) update test cleanup - [`4355248`](https://github.com/netbirdio/netbird/commit/43552480743161bde29327dbb1912ef9a7c9317c) fix test ### 📊 Changes **3 files changed** (+505 additions, -26 deletions) <details> <summary>View changed files</summary> ➕ `management/server/telemetry/account_aggregator.go` (+185 -0) ➕ `management/server/telemetry/account_aggregator_test.go` (+219 -0) 📝 `management/server/telemetry/grpc_metrics.go` (+101 -26) </details> ### 📄 Description ## Describe your changes ## Issue ticket number and link ## Stack <!-- branch-stack --> ### Checklist - [ ] Is it a bug fix - [ ] Is a typo/documentation fix - [x] Is a feature enhancement - [ ] It is a refactor - [ ] Created tests that fail without the change (if possible) > By submitting this pull request, you confirm that you have read and agree to the terms of the [Contributor License Agreement](https://github.com/netbirdio/netbird/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT.md). ## Documentation Select exactly one: - [ ] I added/updated documentation for this change - [x] Documentation is **not needed** for this change (explain why) ### Docs PR URL (required if "docs added" is checked) Paste the PR link from https://github.com/netbirdio/docs here: https://github.com/netbirdio/docs/pull/__ <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Per-account P95 latency metrics for sync requests. * Per-account P95 latency metrics for login requests. * Lightweight per-account duration aggregator that records durations and computes P95 values. * Background flushers that periodically publish per-account P95s to metrics. * Graceful shutdown support for the new telemetry components. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 07:09:34 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#28028