diff --git a/CHANGELOG.md b/CHANGELOG.md index 760dca2439a..875efa359d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ ## main / unreleased + +* [CHANGE] Remove `tenant_header_key` option from `tempo-query` config [#2414](https://github.com/grafana/tempo/pull/2414) (@kousikmitra) +* [ENHANCEMENT] Add `prefix` configuration option to `storage.trace.azure` and `storage.trace.gcs` [#2362](https://github.com/grafana/tempo/pull/2386) (@kousikmitra) * [CHANGE] **Breaking Change** Remove support tolerate_failed_blocks. [#2416](https://github.com/grafana/tempo/pull/2416) (@joe-elliott) Removed config option: ``` diff --git a/cmd/tempo-query/tempo/config.go b/cmd/tempo-query/tempo/config.go index accf5a15586..535ed246d69 100644 --- a/cmd/tempo-query/tempo/config.go +++ b/cmd/tempo-query/tempo/config.go @@ -2,16 +2,14 @@ package tempo import ( "github.com/grafana/dskit/crypto/tls" - "github.com/jaegertracing/jaeger/plugin/storage/grpc/shared" "github.com/spf13/viper" ) // Config holds the configuration for redbull. type Config struct { - Backend string `yaml:"backend"` - TLSEnabled bool `yaml:"tls_enabled" category:"advanced"` - TLS tls.ClientConfig `yaml:",inline"` - TenantHeaderKey string `yaml:"tenant_header_key"` + Backend string `yaml:"backend"` + TLSEnabled bool `yaml:"tls_enabled" category:"advanced"` + TLS tls.ClientConfig `yaml:",inline"` } // InitFromViper initializes the options struct with values from Viper @@ -25,10 +23,4 @@ func (c *Config) InitFromViper(v *viper.Viper) { c.TLS.InsecureSkipVerify = v.GetBool("tls_insecure_skip_verify") c.TLS.CipherSuites = v.GetString("tls_cipher_suites") c.TLS.MinVersion = v.GetString("tls_min_version") - - tenantHeader := v.GetString("tenant_header_key") - if tenantHeader == "" { - tenantHeader = shared.BearerTokenKey - } - c.TenantHeaderKey = tenantHeader } diff --git a/cmd/tempo-query/tempo/plugin.go b/cmd/tempo-query/tempo/plugin.go index 47e964cf369..3e0a64e76c4 100644 --- a/cmd/tempo-query/tempo/plugin.go +++ b/cmd/tempo-query/tempo/plugin.go @@ -24,6 +24,7 @@ import ( "google.golang.org/grpc/metadata" jaeger "github.com/jaegertracing/jaeger/model" + "github.com/jaegertracing/jaeger/plugin/storage/grpc/shared" jaeger_spanstore "github.com/jaegertracing/jaeger/storage/spanstore" ot_jaeger "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger" @@ -53,11 +54,10 @@ var tlsVersions = map[string]uint16{ } type Backend struct { - tempoBackend string - tlsEnabled bool - tls tlsCfg.ClientConfig - httpClient *http.Client - tenantHeaderKey string + tempoBackend string + tlsEnabled bool + tls tlsCfg.ClientConfig + httpClient *http.Client } func New(cfg *Config) (*Backend, error) { @@ -66,11 +66,10 @@ func New(cfg *Config) (*Backend, error) { return nil, err } return &Backend{ - tempoBackend: cfg.Backend, - tlsEnabled: cfg.TLSEnabled, - tls: cfg.TLS, - httpClient: httpClient, - tenantHeaderKey: cfg.TenantHeaderKey, + tempoBackend: cfg.Backend, + tlsEnabled: cfg.TLSEnabled, + tls: cfg.TLS, + httpClient: httpClient, }, nil } @@ -438,7 +437,7 @@ func (b *Backend) newGetRequest(ctx context.Context, url string, span opentracin // currently Jaeger Query will only propagate bearer token to the grpc backend and no other headers // so we are going to extract the tenant id from the header, if it exists and use it - tenantID, found := extractBearerToken(ctx, b.tenantHeaderKey) + tenantID, found := extractBearerToken(ctx) if found { req.Header.Set(user.OrgIDHeaderName, tenantID) } @@ -446,9 +445,9 @@ func (b *Backend) newGetRequest(ctx context.Context, url string, span opentracin return req, nil } -func extractBearerToken(ctx context.Context, tenantHeader string) (string, bool) { +func extractBearerToken(ctx context.Context) (string, bool) { if md, ok := metadata.FromIncomingContext(ctx); ok { - values := md.Get(tenantHeader) + values := md.Get(shared.BearerTokenKey) if len(values) > 0 { return values[0], true }