| 
									
										
										
										
											2022-06-28 15:25:30 +08:00
										 |  |  | package setting | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | type GrafanaJavascriptAgent struct { | 
					
						
							|  |  |  | 	Enabled                             bool   `json:"enabled"` | 
					
						
							|  |  |  | 	CustomEndpoint                      string `json:"customEndpoint"` | 
					
						
							|  |  |  | 	EndpointRPS                         int    `json:"-"` | 
					
						
							|  |  |  | 	EndpointBurst                       int    `json:"-"` | 
					
						
							| 
									
										
										
										
											2024-10-18 21:35:39 +08:00
										 |  |  | 	AllInstrumentationsEnabeld          bool   `json:"allInstrumentationEnabeld"` | 
					
						
							| 
									
										
										
										
											2022-06-28 15:25:30 +08:00
										 |  |  | 	ErrorInstrumentalizationEnabled     bool   `json:"errorInstrumentalizationEnabled"` | 
					
						
							|  |  |  | 	ConsoleInstrumentalizationEnabled   bool   `json:"consoleInstrumentalizationEnabled"` | 
					
						
							|  |  |  | 	WebVitalsInstrumentalizationEnabled bool   `json:"webVitalsInstrumentalizationEnabled"` | 
					
						
							| 
									
										
										
										
											2024-07-31 21:13:05 +08:00
										 |  |  | 	TracingInstrumentalizationEnabled   bool   `json:"tracingInstrumentalizationEnabled"` | 
					
						
							| 
									
										
										
										
											2024-02-01 22:08:40 +08:00
										 |  |  | 	InternalLoggerLevel                 int    `json:"internalLoggerLevel"` | 
					
						
							| 
									
										
										
										
											2022-06-28 15:25:30 +08:00
										 |  |  | 	ApiKey                              string `json:"apiKey"` | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | func (cfg *Cfg) readGrafanaJavascriptAgentConfig() { | 
					
						
							|  |  |  | 	raw := cfg.Raw.Section("log.frontend") | 
					
						
							| 
									
										
										
										
											2023-05-02 17:10:56 +08:00
										 |  |  | 	cfg.GrafanaJavascriptAgent = GrafanaJavascriptAgent{ | 
					
						
							|  |  |  | 		Enabled:                             raw.Key("enabled").MustBool(true), | 
					
						
							|  |  |  | 		CustomEndpoint:                      raw.Key("custom_endpoint").MustString("/log-grafana-javascript-agent"), | 
					
						
							|  |  |  | 		EndpointRPS:                         raw.Key("log_endpoint_requests_per_second_limit").MustInt(3), | 
					
						
							|  |  |  | 		EndpointBurst:                       raw.Key("log_endpoint_burst_limit").MustInt(15), | 
					
						
							| 
									
										
										
										
											2024-10-18 22:52:46 +08:00
										 |  |  | 		AllInstrumentationsEnabeld:          raw.Key("instrumentations_all_enabled").MustBool(false), | 
					
						
							| 
									
										
										
										
											2023-05-02 17:10:56 +08:00
										 |  |  | 		ErrorInstrumentalizationEnabled:     raw.Key("instrumentations_errors_enabled").MustBool(true), | 
					
						
							|  |  |  | 		ConsoleInstrumentalizationEnabled:   raw.Key("instrumentations_console_enabled").MustBool(true), | 
					
						
							|  |  |  | 		WebVitalsInstrumentalizationEnabled: raw.Key("instrumentations_webvitals_enabled").MustBool(true), | 
					
						
							| 
									
										
										
										
											2024-07-31 21:13:05 +08:00
										 |  |  | 		TracingInstrumentalizationEnabled:   raw.Key("instrumentations_tracing_enabled").MustBool(true), | 
					
						
							| 
									
										
										
										
											2024-02-01 22:08:40 +08:00
										 |  |  | 		InternalLoggerLevel:                 raw.Key("internal_logger_level").MustInt(0), | 
					
						
							| 
									
										
										
										
											2023-05-02 17:10:56 +08:00
										 |  |  | 		ApiKey:                              raw.Key("api_key").String(), | 
					
						
							| 
									
										
										
										
											2022-06-28 15:25:30 +08:00
										 |  |  | 	} | 
					
						
							|  |  |  | } |