MCPcopy
hub / github.com/grafana/tempo / InitFromViper

Method InitFromViper

cmd/tempo-query/tempo/config.go:27–54  ·  view source on GitHub ↗

InitFromViper initializes the options struct with values from Viper

(v *viper.Viper)

Source from the content-addressed store, hash-verified

25
26// InitFromViper initializes the options struct with values from Viper
27func (c *Config) InitFromViper(v *viper.Viper) {
28 address := v.GetString("address")
29 if address == "" {
30 address = "0.0.0.0:7777"
31 }
32 c.Address = address
33 c.Backend = v.GetString("backend")
34 c.TLSEnabled = v.GetBool("tls_enabled")
35 c.TLSServerEnabeld = v.GetBool("tls_server_enabled")
36 c.TLS.CertPath = v.GetString("tls_cert_path")
37 c.TLS.KeyPath = v.GetString("tls_key_path")
38 c.TLS.CAPath = v.GetString("tls_ca_path")
39 c.TLS.ServerName = v.GetString("tls_server_name")
40 c.TLS.InsecureSkipVerify = v.GetBool("tls_insecure_skip_verify")
41 c.TLS.CipherSuites = v.GetString("tls_cipher_suites")
42 c.TLS.MinVersion = v.GetString("tls_min_version")
43 c.QueryServicesDuration = v.GetString("services_query_duration")
44 c.FindTracesConcurrentRequests = v.GetInt("find_traces_concurrent_requests")
45
46 if c.FindTracesConcurrentRequests == 0 {
47 c.FindTracesConcurrentRequests = 1
48 }
49 tenantHeader := v.GetString("tenant_header_key")
50 if tenantHeader == "" {
51 tenantHeader = bearerTokenKey
52 }
53 c.TenantHeaderKey = tenantHeader
54}

Callers 1

mainFunction · 0.95

Calls 2

GetBoolMethod · 0.80
GetIntMethod · 0.80

Tested by

no test coverage detected