mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Add deprecation warnings for Sentry (#60165)
This commit is contained in:
parent
fe3ae49cce
commit
c2cea076ee
6
.github/renovate.json5
vendored
6
.github/renovate.json5
vendored
@ -21,6 +21,12 @@
|
|||||||
"ts-loader", // we should remove ts-loader and use babel-loader instead
|
"ts-loader", // we should remove ts-loader and use babel-loader instead
|
||||||
"ora", // we should bump this once we move to esm modules
|
"ora", // we should bump this once we move to esm modules
|
||||||
|
|
||||||
|
// Sentry deprecated in favor of Grafana Faro for frontend logging.
|
||||||
|
// Major effort required to upgrade to latest Sentry, not worthwhile
|
||||||
|
"@sentry/browser",
|
||||||
|
"@sentry/types",
|
||||||
|
"@sentry/utils",
|
||||||
|
|
||||||
// dep updates blocked by React 18
|
// dep updates blocked by React 18
|
||||||
"@testing-library/react",
|
"@testing-library/react",
|
||||||
"@types/react",
|
"@types/react",
|
||||||
|
@ -19,6 +19,7 @@ type frontendLogMessageHandler func(hs *HTTPServer, c *web.Context)
|
|||||||
const sentryLogEndpointPath = "/log"
|
const sentryLogEndpointPath = "/log"
|
||||||
const grafanaJavascriptAgentEndpointPath = "/log-grafana-javascript-agent"
|
const grafanaJavascriptAgentEndpointPath = "/log-grafana-javascript-agent"
|
||||||
|
|
||||||
|
/** @deprecated will be removed in the next major version */
|
||||||
func NewFrontendLogMessageHandler(store *frontendlogging.SourceMapStore) frontendLogMessageHandler {
|
func NewFrontendLogMessageHandler(store *frontendlogging.SourceMapStore) frontendLogMessageHandler {
|
||||||
return func(hs *HTTPServer, c *web.Context) {
|
return func(hs *HTTPServer, c *web.Context) {
|
||||||
event := frontendlogging.FrontendSentryEvent{}
|
event := frontendlogging.FrontendSentryEvent{}
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package setting
|
package setting
|
||||||
|
|
||||||
|
import "github.com/go-kit/kit/log/level"
|
||||||
|
|
||||||
type Sentry struct {
|
type Sentry struct {
|
||||||
Enabled bool `json:"enabled"`
|
Enabled bool `json:"enabled"`
|
||||||
DSN string `json:"dsn"`
|
DSN string `json:"dsn"`
|
||||||
@ -13,6 +15,7 @@ func (cfg *Cfg) readSentryConfig() {
|
|||||||
raw := cfg.Raw.Section("log.frontend")
|
raw := cfg.Raw.Section("log.frontend")
|
||||||
provider := raw.Key("provider").MustString("sentry")
|
provider := raw.Key("provider").MustString("sentry")
|
||||||
if provider == "sentry" || provider != "grafana" {
|
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{
|
cfg.Sentry = Sentry{
|
||||||
Enabled: raw.Key("enabled").MustBool(true),
|
Enabled: raw.Key("enabled").MustBool(true),
|
||||||
DSN: raw.Key("sentry_dsn").String(),
|
DSN: raw.Key("sentry_dsn").String(),
|
||||||
|
Loading…
Reference in New Issue
Block a user