Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP][v2][storage] Move storage selection into extension #6273

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions cmd/jaeger/internal/extension/jaegerstorage/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ var (
type Config struct {
TraceBackends map[string]TraceBackend `mapstructure:"backends"`
MetricBackends map[string]MetricBackend `mapstructure:"metric_backends"`
Roles Roles `mapstructure:"roles"`
}

// TraceBackend contains configuration for a single trace storage backend.
Expand All @@ -54,6 +55,17 @@ type MetricBackend struct {
Prometheus *promCfg.Configuration `mapstructure:"prometheus"`
}

// Roles defines the association between storage roles and their corresponding backends.
// Each field specifies the name of the backend responsible for handling a particular role.
type Roles struct {
// Traces specifies the name of the backend responsible for storing traces.
Traces string `mapstructure:"traces"`
// TracesArchive specifies the name of the backend responsible for storing archived traces.
TracesArchive string `mapstructure:"traces_archive"`
// Metrics specifies the name of the backend responsible for storing metrics.
Metrics string `mapstructure:"metrics"`
}

// Unmarshal implements confmap.Unmarshaler. This allows us to provide
// defaults for different configs. It cannot be done in createDefaultConfig()
// because at that time we don't know which backends the user wants to use.
Expand Down Expand Up @@ -107,6 +119,7 @@ func (cfg *Config) Validate() error {
return fmt.Errorf("empty backend configuration for storage '%s'", name)
}
}
// TODO: implement validation for roles
return nil
}

Expand Down
Loading