Fix METRIC_ENABLED to METRICS_ENABLED in fly component (#469)
This commit is contained in:
parent
914580cfdc
commit
1ba76b5c85
|
@ -14,4 +14,4 @@ PPROF_ENABLED=false
|
|||
MAX_HEALTH_TIME_SECONDS=90
|
||||
AWS_IAM_ROLE=
|
||||
ALERT_ENABLED=false
|
||||
METRIC_ENABLED=false
|
||||
METRICS_ENABLED=false
|
|
@ -14,4 +14,4 @@ PPROF_ENABLED=true
|
|||
MAX_HEALTH_TIME_SECONDS=90
|
||||
AWS_IAM_ROLE=
|
||||
ALERT_ENABLED=false
|
||||
METRIC_ENABLED=false
|
||||
METRICS_ENABLED=false
|
|
@ -14,4 +14,4 @@ PPROF_ENABLED=false
|
|||
MAX_HEALTH_TIME_SECONDS=300
|
||||
AWS_IAM_ROLE=
|
||||
ALERT_ENABLED=false
|
||||
METRIC_ENABLED=false
|
||||
METRICS_ENABLED=false
|
|
@ -70,11 +70,11 @@ spec:
|
|||
name: opsgenie
|
||||
key: api-key
|
||||
- name: ALERT_ENABLED
|
||||
value: {{ .ALERT_ENABLED }}
|
||||
value: "{{ .ALERT_ENABLED }}"
|
||||
- name: ENVIRONMENT
|
||||
value: {{ .ENVIRONMENT }}
|
||||
- name: METRIC_ENABLED
|
||||
value: {{ .METRIC_ENABLED }}
|
||||
- name: METRICS_ENABLED
|
||||
value: "{{ .METRICS_ENABLED }}"
|
||||
resources:
|
||||
limits:
|
||||
memory: {{ .RESOURCES_LIMITS_MEMORY }}
|
||||
|
|
|
@ -106,12 +106,12 @@ func getAlertApiKey() string {
|
|||
return os.Getenv("ALERT_API_KEY")
|
||||
}
|
||||
|
||||
// GetMetricEnabled get if metric is enabled.
|
||||
func GetMetricEnabled() bool {
|
||||
strMetricEnabled := os.Getenv("METRIC_ENABLED")
|
||||
metricEnabled, err := strconv.ParseBool(strMetricEnabled)
|
||||
// GetMetricsEnabled get if metrics is enabled.
|
||||
func GetMetricsEnabled() bool {
|
||||
strMetricsEnabled := os.Getenv("METRICS_ENABLED")
|
||||
metricsEnabled, err := strconv.ParseBool(strMetricsEnabled)
|
||||
if err != nil {
|
||||
metricEnabled = false
|
||||
metricsEnabled = false
|
||||
}
|
||||
return metricEnabled
|
||||
return metricsEnabled
|
||||
}
|
||||
|
|
|
@ -196,8 +196,8 @@ func newAlertClient() (alert.AlertClient, error) {
|
|||
}
|
||||
|
||||
func newMetrics(p2pNetwork *config.P2pNetworkConfig) metrics.Metrics {
|
||||
metricEnabled := config.GetMetricEnabled()
|
||||
if !metricEnabled {
|
||||
metricsEnabled := config.GetMetricsEnabled()
|
||||
if !metricsEnabled {
|
||||
return metrics.NewDummyMetrics()
|
||||
}
|
||||
return metrics.NewPrometheusMetrics(p2pNetwork.Enviroment)
|
||||
|
|
Loading…
Reference in New Issue