[PR #2235] [MERGED] Fix issue with canceled context before pushing metrics and decreasing pushing interval #14840

Closed
opened 2026-08-05 03:06:25 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/2235
Author: @mlsmaycon
Created: 7/4/2024
Status: Merged
Merged: 7/4/2024
Merged by: @mlsmaycon

Base: mainHead: fix/metrics-context-and-decrease-default-interval


📝 Commits (2)

  • ef1bc50 Fix issue with canceled context and decreasing metrics interval
  • ff61abb update doc URL

📊 Changes

1 file changed (+26 additions, -8 deletions)

View changed files

📝 management/server/metrics/selfhosted.go (+26 -8)

📄 Description

Describe your changes

Fix a bug where the post context was canceled before sending metrics to the server.

The interval time was decreased, and an optional environment variable NETBIRD_METRICS_INTERVAL_IN_SECONDS was added to control the interval time.

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)
  • Extended the README / documentation, if necessary

🔄 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/2235 **Author:** [@mlsmaycon](https://github.com/mlsmaycon) **Created:** 7/4/2024 **Status:** ✅ Merged **Merged:** 7/4/2024 **Merged by:** [@mlsmaycon](https://github.com/mlsmaycon) **Base:** `main` ← **Head:** `fix/metrics-context-and-decrease-default-interval` --- ### 📝 Commits (2) - [`ef1bc50`](https://github.com/netbirdio/netbird/commit/ef1bc50425a9245f4a9366ac2a9519e5b8f3ca3a) Fix issue with canceled context and decreasing metrics interval - [`ff61abb`](https://github.com/netbirdio/netbird/commit/ff61abbd812e79d8c559fec3202edf09a67a1e8e) update doc URL ### 📊 Changes **1 file changed** (+26 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `management/server/metrics/selfhosted.go` (+26 -8) </details> ### 📄 Description ## Describe your changes Fix a bug where the post context was canceled before sending metrics to the server. The interval time was decreased, and an optional environment variable NETBIRD_METRICS_INTERVAL_IN_SECONDS was added to control the interval time. ## Issue ticket number and link ### Checklist - [x] Is it a bug fix - [ ] Is a typo/documentation fix - [ ] Is a feature enhancement - [x] It is a refactor - [ ] Created tests that fail without the change (if possible) - [ ] Extended the README / documentation, if necessary --- <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 03:06:25 -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#14840