Skip to content

Commit

Permalink
Remove unnecessary template param from constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
titolins committed Sep 5, 2024
1 parent 66c1ca4 commit af62cde
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
4 changes: 1 addition & 3 deletions pkg/alertmanager/alertmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ type Replicator interface {
}

// New creates a new Alertmanager.
func New(cfg *Config, reg *prometheus.Registry, tmplExternalURL *url.URL) (*Alertmanager, error) {
func New(cfg *Config, reg *prometheus.Registry) (*Alertmanager, error) {
if cfg.TenantDataDir == "" {
return nil, fmt.Errorf("directory for tenant-specific AlertManager is not configured")
}
Expand All @@ -210,8 +210,6 @@ func New(cfg *Config, reg *prometheus.Registry, tmplExternalURL *url.URL) (*Aler
Name: "alertmanager_notification_rate_limited_total",
Help: "Number of rate-limited notifications per integration.",
}, []string{"integration"}), // "integration" is consistent with other alertmanager metrics.

tmplExternalURL: tmplExternalURL,
}

am.registry = reg
Expand Down
8 changes: 4 additions & 4 deletions pkg/alertmanager/alertmanager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func createAlertmanagerAndSendAlerts(t *testing.T, alertGroups, groupsLimit, exp
ReplicationFactor: 1,
// We have to set this interval non-zero, though we don't need the persister to do anything.
PersisterConfig: PersisterConfig{Interval: time.Hour},
}, reg, &url.URL{Path: "/am"})
}, reg)
require.NoError(t, err)
defer am.StopAndWait()

Expand Down Expand Up @@ -167,7 +167,7 @@ func TestDispatcherLoggerInsightKey(t *testing.T) {
Replicator: &stubReplicator{},
ReplicationFactor: 1,
PersisterConfig: PersisterConfig{Interval: time.Hour},
}, reg, &url.URL{Path: "/am"})
}, reg)
require.NoError(t, err)
defer am.StopAndWait()

Expand Down Expand Up @@ -373,7 +373,7 @@ func TestSilenceLimits(t *testing.T) {
// We have set this to 1 hour, but we don't use it in this
// test as we override the broadcast function with SetBroadcast.
PersisterConfig: PersisterConfig{Interval: time.Hour},
}, r, &url.URL{Path: "/am"})
}, r)
require.NoError(t, err)
defer am.StopAndWait()

Expand Down Expand Up @@ -510,7 +510,7 @@ func TestExperimentalReceiversAPI(t *testing.T) {
Replicator: &stubReplicator{},
ReplicationFactor: 1,
PersisterConfig: PersisterConfig{Interval: time.Hour},
}, reg, &url.URL{Path: "/am"})
}, reg)
require.NoError(t, err)
defer am.StopAndWait()

Expand Down
2 changes: 1 addition & 1 deletion pkg/alertmanager/multitenant.go
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ func (am *MultitenantAlertmanager) newAlertmanager(userID string, amConfig *defi
Limits: am.limits,
Features: am.features,
GrafanaAlertmanagerCompatibility: am.cfg.GrafanaAlertmanagerCompatibilityEnabled,
}, reg, tmplExternalURL)
}, reg)
if err != nil {
return nil, fmt.Errorf("unable to start Alertmanager for user %v: %v", userID, err)
}
Expand Down

0 comments on commit af62cde

Please sign in to comment.