grafana/pkg/setting/setting_grafana_javascript_agent.go
Tobias Skarhed b0bf2006e5
Chore: Upgrade Grafana Faro to v2, removing web_vitals_attribution_enabled (#117516)
* Chore: Upgrade Grafana Faro to v2.2.2

Upgrades @grafana/faro-* packages from v1.19.0 to v2.2.2 and removes the webVitalsAttribution configuration option which is now always enabled in Faro v2.

Closes #117234

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* Remove WebVitalsAttributionEnabled field from Go config struct

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* Add NavigationInstrumentation to test

* bump to 2.2.3

---------

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-10 05:43:30 -05:00

36 lines
1.9 KiB
Go

package setting
type GrafanaJavascriptAgent struct {
EndpointRPS int `json:"-"`
EndpointBurst int `json:"-"`
// Faro config
Enabled bool `json:"enabled"`
CustomEndpoint string `json:"customEndpoint"`
ApiKey string `json:"apiKey"`
InternalLoggerLevel int `json:"internalLoggerLevel"`
ConsoleInstrumentalizationEnabled bool `json:"consoleInstrumentalizationEnabled"`
PerformanceInstrumentalizationEnabled bool `json:"performanceInstrumentalizationEnabled"`
CSPInstrumentalizationEnabled bool `json:"cspInstrumentalizationEnabled"`
TracingInstrumentalizationEnabled bool `json:"tracingInstrumentalizationEnabled"`
BotFilterEnabled bool `json:"botFilterEnabled"`
}
func (cfg *Cfg) readGrafanaJavascriptAgentConfig() {
raw := cfg.Raw.Section("log.frontend")
cfg.GrafanaJavascriptAgent = GrafanaJavascriptAgent{
EndpointRPS: raw.Key("log_endpoint_requests_per_second_limit").MustInt(3),
EndpointBurst: raw.Key("log_endpoint_burst_limit").MustInt(15),
// Faro config
Enabled: raw.Key("enabled").MustBool(false),
CustomEndpoint: raw.Key("custom_endpoint").MustString("/log-grafana-javascript-agent"),
ApiKey: raw.Key("api_key").String(),
InternalLoggerLevel: raw.Key("internal_logger_level").MustInt(0),
ConsoleInstrumentalizationEnabled: raw.Key("instrumentations_console_enabled").MustBool(true),
PerformanceInstrumentalizationEnabled: raw.Key("instrumentations_performance_enabled").MustBool(true),
CSPInstrumentalizationEnabled: raw.Key("instrumentations_csp_enabled").MustBool(true),
TracingInstrumentalizationEnabled: raw.Key("instrumentations_tracing_enabled").MustBool(true),
BotFilterEnabled: raw.Key("bot_filter_enabled").MustBool(false),
}
}