-
Notifications
You must be signed in to change notification settings - Fork 182
PMM-12478 external exporter status #4726
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
base: v3
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## v3 #4726 +/- ##
==========================================
- Coverage 45.75% 45.62% -0.13%
==========================================
Files 364 365 +1
Lines 37755 37848 +93
==========================================
- Hits 17275 17269 -6
- Misses 18823 18920 +97
- Partials 1657 1659 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| map<string, string> custom_labels = 7; | ||
| // Group name of external service. | ||
| string group = 8; | ||
| // Access address (DNS name or IP). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // Access address (DNS name or IP). | |
| // Service address (DNS name or IP). |
| string group = 8; | ||
| // Access address (DNS name or IP). | ||
| string address = 9; | ||
| // Access port. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // Access port. | |
| // Service port. |
|
|
||
| s.l.Debugf("Updating status for %d external exporters.", len(statusMap)) | ||
|
|
||
| err = s.db.InTransaction(func(tx *reform.TX) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better use .InTransactionContext wherever the context is available.
| status = inventoryv1.AgentStatus_AGENT_STATUS_UNKNOWN | ||
| } | ||
|
|
||
| err = s.db.InTransaction(func(tx *reform.TX) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.InTransactionContext?
managed/services/inventory/agents.go
Outdated
| // This allows VictoriaMetrics to scrape the exporter and generate 'up' metric | ||
| agentID := agent.AgentId | ||
| go func() { | ||
| time.Sleep(15 * time.Second) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be a magic number or a named constant?
managed/services/inventory/agents.go
Outdated
| // This allows VictoriaMetrics to scrape the exporter and generate 'up' metric | ||
| agentID := agent.AgentId | ||
| go func() { | ||
| time.Sleep(15 * time.Second) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO everything should be context-bound and the sleep itself should be cancellable.
PMM-12478
Link to the Feature Build: SUBMODULES-0
If this PR adds, removes or alters one or more API endpoints, please review and add or update the relevant API documentation as well:
If this PR is related to some other PRs in this or other repositories, please provide links to those PRs: