-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Multiple clusters per trigger source (#981)
- Loading branch information
1 parent
7177fe5
commit d19b019
Showing
84 changed files
with
1,848 additions
and
1,774 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,8 @@ package api | |
import ( | ||
"net/http" | ||
"time" | ||
|
||
"github.com/moira-alert/moira" | ||
) | ||
|
||
// WebContact is container for web ui contact validation. | ||
|
@@ -30,21 +32,27 @@ type Sentry struct { | |
|
||
// Config for api configuration variables. | ||
type Config struct { | ||
EnableCORS bool | ||
Listen string | ||
GraphiteLocalMetricTTL time.Duration | ||
GraphiteRemoteMetricTTL time.Duration | ||
PrometheusRemoteMetricTTL time.Duration | ||
Flags FeatureFlags | ||
EnableCORS bool | ||
Listen string | ||
MetricsTTL map[moira.ClusterKey]time.Duration | ||
Flags FeatureFlags | ||
} | ||
|
||
// WebConfig is container for web ui configuration parameters. | ||
type WebConfig struct { | ||
SupportEmail string `json:"supportEmail,omitempty" example:"[email protected]"` | ||
RemoteAllowed bool `json:"remoteAllowed" example:"true"` | ||
Contacts []WebContact `json:"contacts"` | ||
FeatureFlags FeatureFlags `json:"featureFlags"` | ||
Sentry Sentry `json:"sentry"` | ||
SupportEmail string `json:"supportEmail,omitempty" example:"[email protected]"` | ||
RemoteAllowed bool `json:"remoteAllowed" example:"true"` | ||
MetricSourceClusters []MetricSourceCluster `json:"metric_source_clusters"` | ||
Contacts []WebContact `json:"contacts"` | ||
FeatureFlags FeatureFlags `json:"featureFlags"` | ||
Sentry Sentry `json:"sentry"` | ||
} | ||
|
||
// MetricSourceCluster contains data about supported metric source cluster | ||
type MetricSourceCluster struct { | ||
TriggerSource moira.TriggerSource `json:"trigger_source" example:"graphite_remote"` | ||
ClusterId moira.ClusterId `json:"cluster_id" example:"default"` | ||
ClusterName string `json:"cluster_name" example:"Graphite Remote Prod"` | ||
} | ||
|
||
func (WebConfig) Render(w http.ResponseWriter, r *http.Request) error { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.