-
Notifications
You must be signed in to change notification settings - Fork 131
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
PMM-9374 external victoria metrics #1916
Conversation
…toria-metrics # Conflicts: # managed/cmd/pmm-managed/main.go # managed/services/agents/vmagent.go
Codecov Report
@@ Coverage Diff @@
## main #1916 +/- ##
==========================================
+ Coverage 42.71% 42.73% +0.02%
==========================================
Files 384 384
Lines 48188 48273 +85
==========================================
+ Hits 20582 20631 +49
- Misses 25668 25700 +32
- Partials 1938 1942 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 3 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@@ -23,11 +23,11 @@ import ( | |||
|
|||
func TestVictoriaMetricsParams(t *testing.T) { | |||
t.Run("read non exist baseConfigFile", func(t *testing.T) { | |||
_, err := NewVictoriaMetricsParams("nonExistConfigFile.yml") | |||
_, err := NewVictoriaMetricsParams("nonExistConfigFile.yml", "", "", "") |
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.
🚫 [golangci] reported by reviewdog 🐶
too many arguments in call to NewVictoriaMetricsParams
require.NoError(t, err) | ||
}) | ||
t.Run("check params for VMAlert", func(t *testing.T) { | ||
vmp, err := NewVictoriaMetricsParams("../testdata/victoriametrics/prometheus.external.alerts.yml") | ||
vmp, err := NewVictoriaMetricsParams("../testdata/victoriametrics/prometheus.external.alerts.yml", "", "", "") |
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.
🚫 [golangci] reported by reviewdog 🐶
too many arguments in call to NewVictoriaMetricsParams
@@ -23,11 +23,11 @@ | |||
|
|||
func TestVictoriaMetricsParams(t *testing.T) { | |||
t.Run("read non exist baseConfigFile", func(t *testing.T) { | |||
_, err := NewVictoriaMetricsParams("nonExistConfigFile.yml") | |||
_, err := NewVictoriaMetricsParams("nonExistConfigFile.yml", "", "", "") |
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.
🚫 [golangci] reported by reviewdog 🐶
too many arguments in call to NewVictoriaMetricsParams
require.NoError(t, err) | ||
}) | ||
t.Run("check params for VMAlert", func(t *testing.T) { | ||
vmp, err := NewVictoriaMetricsParams("../testdata/victoriametrics/prometheus.external.alerts.yml") | ||
vmp, err := NewVictoriaMetricsParams("../testdata/victoriametrics/prometheus.external.alerts.yml", "", "", "") |
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.
🚫 [golangci] reported by reviewdog 🐶
too many arguments in call to NewVictoriaMetricsParams
managed/services/supervisord/logs.go
Outdated
func NewLogs(pmmVersion string, pmmUpdateChecker *PMMUpdateChecker) *Logs { | ||
func NewLogs(pmmVersion string, pmmUpdateChecker *PMMUpdateChecker, vmParams *models.VictoriaMetricsParams) *Logs { | ||
return &Logs{ |
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.
Maybe we could do it in a more abstract manner? For example vmParams getter? Than if in future we change mechanism that gets us a new vmParams we wont rewrite this place? )
managed/services/agents/state.go
Outdated
func NewStateUpdater(db *reform.DB, r *Registry, vmdb prometheusService) *StateUpdater { | ||
func NewStateUpdater(db *reform.DB, r *Registry, vmdb prometheusService, vmParams *models.VictoriaMetricsParams) *StateUpdater { | ||
return &StateUpdater{ | ||
db: db, |
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.
Can we change concrete implementation with abstract one?
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.
cool )
} | ||
} | ||
|
||
func relativePath(baseURL string, path string) (*url.URL, 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.
🚫 [golangci] reported by reviewdog 🐶
func relativePath
is unused (unused)
…toria-metrics # Conflicts: # docker-compose.yml # managed/cmd/pmm-managed/main.go # managed/services/supervisord/devcontainer_test.go # managed/services/supervisord/supervisord_test.go # managed/testdata/supervisord.d/pmm-db_enabled.ini
func NewVictoriaMetricsParams(basePath string) (*VictoriaMetricsParams, error) { | ||
func NewVictoriaMetricsParams(basePath string, vmURL string) (*VictoriaMetricsParams, error) { | ||
if !strings.HasSuffix(vmURL, "/") { | ||
vmURL = vmURL + "/" |
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.
🚫 [golangci] reported by reviewdog 🐶
assignOp: replace vmURL = vmURL + "/"
with vmURL += "/"
(gocritic)
case "PMM_VM_URL": | ||
_, err := url.Parse(v) | ||
if err != nil { | ||
err = fmt.Errorf("invalid value %q for environment variable %q", v, k) |
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.
🚫 [golangci] reported by reviewdog 🐶
ineffectual assignment to err (ineffassign)
PMM-9374
Link to the Feature Build: SUBMODULES-3331
If this PR adds or removes or alters one or more API endpoints, please review and add or update the relevant API documents as well:
If this PR is related to some other PRs in this or other repositories, please provide links to those PRs: