mirror of
https://github.com/grafana/grafana.git
synced 2025-02-16 18:34:52 -06:00
feat(alerting): make it possible to skip ssl verification for alerting https requests
This commit is contained in:
parent
7b9099ef93
commit
aa80b52c07
@ -387,6 +387,9 @@ global_session = -1
|
||||
[alerting]
|
||||
enabled = true
|
||||
|
||||
# Skip ssl validation for queries sent to the timeserie database.
|
||||
skip_ssl_validation = false
|
||||
|
||||
#################################### Internal Grafana Metrics ##########################
|
||||
# Metrics available at HTTP API Url /api/metrics
|
||||
[metrics]
|
||||
|
@ -333,6 +333,9 @@ check_for_updates = true
|
||||
[alerting]
|
||||
;enabled = false
|
||||
|
||||
# Skip ssl validation for queries sent to the timeserie database.
|
||||
;skip_ssl_validation = false
|
||||
|
||||
#################################### Internal Grafana Metrics ##########################
|
||||
# Metrics available at HTTP API Url /api/metrics
|
||||
[metrics]
|
||||
|
@ -141,7 +141,8 @@ var (
|
||||
Quota QuotaSettings
|
||||
|
||||
// Alerting
|
||||
AlertingEnabled bool
|
||||
AlertingEnabled bool
|
||||
AlertingSkipSSLValidation bool
|
||||
|
||||
// logger
|
||||
logger log.Logger
|
||||
@ -546,6 +547,7 @@ func NewConfigContext(args *CommandLineArgs) error {
|
||||
|
||||
alerting := Cfg.Section("alerting")
|
||||
AlertingEnabled = alerting.Key("enabled").MustBool(false)
|
||||
AlertingSkipSSLValidation = alerting.Key("skip_ssl_validation").MustBool(false)
|
||||
|
||||
readSessionConfig()
|
||||
readSmtpSettings()
|
||||
|
@ -1,6 +1,7 @@
|
||||
package graphite
|
||||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
@ -15,10 +16,6 @@ import (
|
||||
"github.com/grafana/grafana/pkg/tsdb"
|
||||
)
|
||||
|
||||
var (
|
||||
HttpClient = http.Client{Timeout: time.Duration(10 * time.Second)}
|
||||
)
|
||||
|
||||
type GraphiteExecutor struct {
|
||||
*tsdb.DataSourceInfo
|
||||
}
|
||||
@ -27,11 +24,23 @@ func NewGraphiteExecutor(dsInfo *tsdb.DataSourceInfo) tsdb.Executor {
|
||||
return &GraphiteExecutor{dsInfo}
|
||||
}
|
||||
|
||||
var glog log.Logger
|
||||
var (
|
||||
glog log.Logger
|
||||
HttpClient http.Client
|
||||
)
|
||||
|
||||
func init() {
|
||||
glog = log.New("tsdb.graphite")
|
||||
tsdb.RegisterExecutor("graphite", NewGraphiteExecutor)
|
||||
|
||||
tr := &http.Transport{
|
||||
TLSClientConfig: &tls.Config{InsecureSkipVerify: setting.AlertingSkipSSLValidation},
|
||||
}
|
||||
|
||||
HttpClient = http.Client{
|
||||
Timeout: time.Duration(10 * time.Second),
|
||||
Transport: tr,
|
||||
}
|
||||
}
|
||||
|
||||
func (e *GraphiteExecutor) Execute(queries tsdb.QuerySlice, context *tsdb.QueryContext) *tsdb.BatchResult {
|
||||
|
Loading…
Reference in New Issue
Block a user