Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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
8 changes: 5 additions & 3 deletions cmd/jaeger/config-badger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ extensions:
http:

jaeger_query:
trace_storage: some_store
trace_storage_archive: another_store
ui_config: ./cmd/jaeger/config-ui.json
storage:
trace: some_store
trace_archive: another_store
ui:
config_file: ./cmd/jaeger/config-ui.json

jaeger_storage:
backends:
Expand Down
8 changes: 5 additions & 3 deletions cmd/jaeger/config-cassandra.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ extensions:
http:

jaeger_query:
trace_storage: some_storage
trace_storage_archive: another_storage
ui_config: ./cmd/jaeger/config-ui.json
storage:
trace: some_storage
trace_archive: another_storage
ui:
config_file: ./cmd/jaeger/config-ui.json

jaeger_storage:
backends:
Expand Down
8 changes: 5 additions & 3 deletions cmd/jaeger/config-elasticsearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ extensions:
http:

jaeger_query:
trace_storage: some_storage
trace_storage_archive: another_storage
ui_config: ./cmd/jaeger/config-ui.json
storage:
trace: some_storage
trace_archive: another_storage
ui:
config_file: ./cmd/jaeger/config-ui.json

jaeger_storage:
backends:
Expand Down
3 changes: 2 additions & 1 deletion cmd/jaeger/config-kafka-ingester.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ extensions:
endpoint: 0.0.0.0:14133

jaeger_query:
trace_storage: some_storage
storage:
trace: some_storage

jaeger_storage:
backends:
Expand Down
8 changes: 5 additions & 3 deletions cmd/jaeger/config-opensearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ extensions:
http:

jaeger_query:
trace_storage: some_storage
trace_storage_archive: another_storage
ui_config: ./cmd/jaeger/config-ui.json
storage:
trace: some_storage
trace_archive: another_storage
ui:
config_file: ./cmd/jaeger/config-ui.json

jaeger_storage:
backends:
Expand Down
6 changes: 4 additions & 2 deletions cmd/jaeger/config-remote-storage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ extensions:
http:

jaeger_query:
trace_storage: some-storage
ui_config: ./cmd/jaeger/config-ui.json
storage:
trace: some-storage
ui:
config_file: ./cmd/jaeger/config-ui.json

jaeger_storage:
backends:
Expand Down
3 changes: 2 additions & 1 deletion cmd/jaeger/config-tail-sampling-always-sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ extensions:
use_v2: true
http:
jaeger_query:
trace_storage: some_storage
storage:
trace: some_storage
jaeger_storage:
backends:
some_storage:
Expand Down
3 changes: 2 additions & 1 deletion cmd/jaeger/config-tail-sampling-service-name-policy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ extensions:
use_v2: true
http:
jaeger_query:
trace_storage: some_storage
storage:
trace: some_storage
jaeger_storage:
backends:
some_storage:
Expand Down
8 changes: 5 additions & 3 deletions cmd/jaeger/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ extensions:
# endpoint: 0.0.0.0:55679

jaeger_query:
trace_storage: some_store
trace_storage_archive: another_store
ui_config: ./cmd/jaeger/config-ui.json
storage:
trace: some_store
trace_archive: another_store
ui:
config_file: ./cmd/jaeger/config-ui.json

jaeger_storage:
backends:
Expand Down
3 changes: 2 additions & 1 deletion cmd/jaeger/internal/all-in-one.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ service:

extensions:
jaeger_query:
trace_storage: some_storage
storage:
trace: some_storage

jaeger_storage:
backends:
Expand Down
25 changes: 18 additions & 7 deletions cmd/jaeger/internal/extension/jaegerquery/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,31 @@ import (
"go.opentelemetry.io/collector/config/confighttp"

queryApp "github.com/jaegertracing/jaeger/cmd/query/app"
"github.com/jaegertracing/jaeger/pkg/tenancy"
)

var _ component.ConfigValidator = (*Config)(nil)

// Config represents the configuration for jaeger-query,
type Config struct {
queryApp.QueryOptionsBase `mapstructure:",squash"`
TraceStoragePrimary string `valid:"required" mapstructure:"trace_storage"`
TraceStorageArchive string `valid:"optional" mapstructure:"trace_storage_archive"`
MetricStorage string `valid:"optional" mapstructure:"metric_storage"`
HTTP confighttp.ServerConfig `mapstructure:",squash"`
GRPC configgrpc.ServerConfig `mapstructure:",squash"`
Tenancy tenancy.Options `mapstructure:"multi_tenancy"`
Connection Connection `mapstructure:"connection"`
Storage Storage `mapstructure:"storage"`
}

type Connection struct {
// HTTP holds the HTTP configuration that the query service uses to serve requests.
HTTP confighttp.ServerConfig `mapstructure:"http"`
// GRPC holds the GRPC configuration that the query service uses to serve requests.
GRPC configgrpc.ServerConfig `mapstructure:"grpc"`
}

type Storage struct {
// TracePrimary contains the name of the primary trace storage that is being queried.
TracePrimary string `mapstructure:"trace" valid:"required"`
// TraceArchive contains the name of the archive trace storage that is being queried.
TraceArchive string `mapstructure:"trace_archive" valid:"optional"`
// Metric contains the name of the metric storage that is being queried.
Metric string `mapstructure:"metric" valid:"optional"`
}

func (cfg *Config) Validate() error {
Expand Down
6 changes: 4 additions & 2 deletions cmd/jaeger/internal/extension/jaegerquery/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ func Test_Validate(t *testing.T) {
{
name: "Empty config",
config: &Config{},
expectedErr: "TraceStoragePrimary: non zero value required",
expectedErr: "Storage.TracePrimary: non zero value required",
},
{
name: "Non empty-config",
config: &Config{
TraceStoragePrimary: "some-storage",
Storage: Storage{
TracePrimary: "some-storage",
},
},
expectedErr: "",
},
Expand Down
18 changes: 12 additions & 6 deletions cmd/jaeger/internal/extension/jaegerquery/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"go.opentelemetry.io/collector/config/confignet"
"go.opentelemetry.io/collector/extension"

"github.com/jaegertracing/jaeger/cmd/query/app"
"github.com/jaegertracing/jaeger/ports"
)

Expand All @@ -27,13 +28,18 @@ func NewFactory() extension.Factory {

func createDefaultConfig() component.Config {
return &Config{
HTTP: confighttp.ServerConfig{
Endpoint: ports.PortToHostPort(ports.QueryHTTP),
QueryOptionsBase: app.QueryOptionsBase{
BasePath: "/",
},
GRPC: configgrpc.ServerConfig{
NetAddr: confignet.AddrConfig{
Endpoint: ports.PortToHostPort(ports.QueryGRPC),
Transport: confignet.TransportTypeTCP,
Connection: Connection{
HTTP: confighttp.ServerConfig{
Endpoint: ports.PortToHostPort(ports.QueryHTTP),
},
GRPC: configgrpc.ServerConfig{
NetAddr: confignet.AddrConfig{
Endpoint: ports.PortToHostPort(ports.QueryGRPC),
Transport: confignet.TransportTypeTCP,
},
},
},
}
Expand Down
18 changes: 9 additions & 9 deletions cmd/jaeger/internal/extension/jaegerquery/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ func (s *server) Start(_ context.Context, host component.Host) error {
mf := otelmetrics.NewFactory(s.telset.MeterProvider)
baseFactory := mf.Namespace(metrics.NSOptions{Name: "jaeger"})
queryMetricsFactory := baseFactory.Namespace(metrics.NSOptions{Name: "query"})
f, err := jaegerstorage.GetStorageFactory(s.config.TraceStoragePrimary, host)
f, err := jaegerstorage.GetStorageFactory(s.config.Storage.TracePrimary, host)
if err != nil {
return fmt.Errorf("cannot find primary storage %s: %w", s.config.TraceStoragePrimary, err)
return fmt.Errorf("cannot find primary storage %s: %w", s.config.Storage.TracePrimary, err)
}

spanReader, err := f.CreateSpanReader()
Expand All @@ -83,7 +83,7 @@ func (s *server) Start(_ context.Context, host component.Host) error {
return err
}

tm := tenancy.NewManager(&s.config.Tenancy)
tm := tenancy.NewManager(&s.config.QueryOptionsBase.Tenancy)

// TODO OTel-collector does not initialize the tracer currently
// https://github.com/open-telemetry/opentelemetry-collector/issues/7532
Expand Down Expand Up @@ -124,12 +124,12 @@ func (s *server) Start(_ context.Context, host component.Host) error {
}

func (s *server) addArchiveStorage(opts *querysvc.QueryServiceOptions, host component.Host) error {
if s.config.TraceStorageArchive == "" {
if s.config.Storage.TraceArchive == "" {
s.telset.Logger.Info("Archive storage not configured")
return nil
}

f, err := jaegerstorage.GetStorageFactory(s.config.TraceStorageArchive, host)
f, err := jaegerstorage.GetStorageFactory(s.config.Storage.TraceArchive, host)
if err != nil {
return fmt.Errorf("cannot find archive storage factory: %w", err)
}
Expand All @@ -141,12 +141,12 @@ func (s *server) addArchiveStorage(opts *querysvc.QueryServiceOptions, host comp
}

func (s *server) createMetricReader(host component.Host) (metricsstore.Reader, error) {
if s.config.MetricStorage == "" {
if s.config.Storage.Metric == "" {
s.telset.Logger.Info("Metric storage not configured")
return disabled.NewMetricsReader()
}

mf, err := jaegerstorage.GetMetricsFactory(s.config.MetricStorage, host)
mf, err := jaegerstorage.GetMetricsFactory(s.config.Storage.Metric, host)
if err != nil {
return nil, fmt.Errorf("cannot find metrics storage factory: %w", err)
}
Expand All @@ -163,8 +163,8 @@ func (s *server) makeQueryOptions() *queryApp.QueryOptions {
QueryOptionsBase: s.config.QueryOptionsBase,

// TODO utilize OTEL helpers for creating HTTP/GRPC servers
HTTPHostPort: s.config.HTTP.Endpoint,
GRPCHostPort: s.config.GRPC.NetAddr.Endpoint,
HTTPHostPort: s.config.Connection.HTTP.Endpoint,
GRPCHostPort: s.config.Connection.GRPC.NetAddr.Endpoint,
// TODO handle TLS
}
}
Expand Down
Loading
Loading