mirror of
https://github.com/grafana/grafana.git
synced 2024-11-24 18:00:31 -06:00
3188a8288e
Introduced after last update to #59732.
29 lines
1.1 KiB
Go
29 lines
1.1 KiB
Go
package setting
|
|
|
|
import "github.com/go-kit/log/level"
|
|
|
|
type Sentry struct {
|
|
Enabled bool `json:"enabled"`
|
|
DSN string `json:"dsn"`
|
|
CustomEndpoint string `json:"customEndpoint"`
|
|
SampleRate float64 `json:"sampleRate"`
|
|
EndpointRPS int `json:"-"`
|
|
EndpointBurst int `json:"-"`
|
|
}
|
|
|
|
func (cfg *Cfg) readSentryConfig() {
|
|
raw := cfg.Raw.Section("log.frontend")
|
|
provider := raw.Key("provider").MustString("sentry")
|
|
if provider == "sentry" || provider != "grafana" {
|
|
_ = level.Warn(cfg.Logger).Log("msg", "\"sentry\" frontend logging provider is deprecated and will be removed in the next major version. Use \"grafana\" provider instead.")
|
|
cfg.Sentry = Sentry{
|
|
Enabled: raw.Key("enabled").MustBool(true),
|
|
DSN: raw.Key("sentry_dsn").String(),
|
|
CustomEndpoint: raw.Key("custom_endpoint").MustString("/log"),
|
|
SampleRate: raw.Key("sample_rate").MustFloat64(),
|
|
EndpointRPS: raw.Key("log_endpoint_requests_per_second_limit").MustInt(3),
|
|
EndpointBurst: raw.Key("log_endpoint_burst_limit").MustInt(15),
|
|
}
|
|
}
|
|
}
|