Skip to content

Commit

Permalink
Initialize Archive Storage For All in One And Query Service
Browse files Browse the repository at this point in the history
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
  • Loading branch information
mahadzaryab1 committed Nov 3, 2024
1 parent bbe3aa7 commit 46308b6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion cmd/all-in-one/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ func main() {
if err != nil {
log.Fatalf("Cannot initialize storage factory: %v", err)
}
archiveStorageFactory, err := storage.NewFactory(storage.FactoryConfigFromEnvAndCLI(os.Args, os.Stderr), true)
if err != nil {
log.Fatalf("Cannot initialize archive storage factory: %v", err)
}
samplingStrategyFactoryConfig, err := ss.FactoryConfigFromEnv()
if err != nil {
log.Fatalf("Cannot initialize sampling strategy factory config: %v", err)
Expand Down Expand Up @@ -164,7 +168,7 @@ by default uses only in-memory database.`,
}
// query
querySrv := startQuery(
svc, qOpts, qOpts.BuildQueryServiceOptions(storageFactory, logger),
svc, qOpts, qOpts.BuildQueryServiceOptions(archiveStorageFactory, logger),
spanReader, dependencyReader, metricsQueryService,
tm, telset,
)
Expand Down
7 changes: 6 additions & 1 deletion cmd/query/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ func main() {
log.Fatalf("Cannot initialize storage factory: %v", err)
}

archiveStorageFactory, err := storage.NewFactory(storage.FactoryConfigFromEnvAndCLI(os.Args, os.Stderr), true)
if err != nil {
log.Fatalf("Cannot initialize archive storage factory: %v", err)
}

fc := metricsPlugin.FactoryConfigFromEnv()
metricsReaderFactory, err := metricsPlugin.NewFactory(fc)
if err != nil {
Expand Down Expand Up @@ -98,7 +103,7 @@ func main() {
if err != nil {
logger.Fatal("Failed to create metrics query service", zap.Error(err))
}
queryServiceOptions := queryOpts.BuildQueryServiceOptions(storageFactory, logger)
queryServiceOptions := queryOpts.BuildQueryServiceOptions(archiveStorageFactory, logger)
queryService := querysvc.NewQueryService(
spanReader,
dependencyReader,
Expand Down

0 comments on commit 46308b6

Please sign in to comment.