Skip to content

Commit

Permalink
Replace grpc-plugin storage type name with just grpc (#5442)
Browse files Browse the repository at this point in the history
## Which problem is this PR solving?
- Resolves #4647

## Description of the changes
- Add new storage type `grpc` and log warning if the old value
`grpc-plugin` is used.

## How was this change tested?
- CII

Signed-off-by: Yuri Shkuro <[email protected]>
  • Loading branch information
yurishkuro authored May 12, 2024
1 parent 98abc11 commit 84ea40e
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 14 deletions.
4 changes: 2 additions & 2 deletions crossdock/jaeger-docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ services:
- "14250"
- "9411:9411"
environment:
- SPAN_STORAGE_TYPE=grpc-plugin
- SPAN_STORAGE_TYPE=grpc
- LOG_LEVEL=debug
restart: on-failure
depends_on:
Expand All @@ -37,7 +37,7 @@ services:
- "16686:16686"
- "16687"
environment:
- SPAN_STORAGE_TYPE=grpc-plugin
- SPAN_STORAGE_TYPE=grpc
restart: on-failure
depends_on:
- jaeger-remote-storage
Expand Down
4 changes: 2 additions & 2 deletions docker-compose/kafka/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ services:
- "--grpc-storage.server=jaeger-remote-storage:17271"
- "--log-level=debug"
environment:
- SPAN_STORAGE_TYPE=grpc-plugin
- SPAN_STORAGE_TYPE=grpc
- KAFKA_CONSUMER_BROKERS=kafka:9092
healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:14270/ || exit 1"]
Expand Down Expand Up @@ -117,7 +117,7 @@ services:
- "--grpc-storage.server=jaeger-remote-storage:17271"
- "--log-level=debug"
environment:
- SPAN_STORAGE_TYPE=grpc-plugin
- SPAN_STORAGE_TYPE=grpc
- JAEGER_AGENT_HOST=jaeger-agent
ports:
- "16686:16686"
Expand Down
7 changes: 4 additions & 3 deletions plugin/storage/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ const (
elasticsearchStorageType = "elasticsearch"
memoryStorageType = "memory"
kafkaStorageType = "kafka"
grpcPluginStorageType = "grpc-plugin"
grpcStorageType = "grpc"
grpcPluginDeprecated = "grpc-plugin"
badgerStorageType = "badger"
blackholeStorageType = "blackhole"

Expand All @@ -67,7 +68,7 @@ var AllStorageTypes = []string{
kafkaStorageType,
badgerStorageType,
blackholeStorageType,
grpcPluginStorageType,
grpcStorageType,
}

// AllSamplingStorageTypes returns all storage backends that implement adaptive sampling
Expand Down Expand Up @@ -135,7 +136,7 @@ func (f *Factory) getFactoryOfType(factoryType string) (storage.Factory, error)
return kafka.NewFactory(), nil
case badgerStorageType:
return badger.NewFactory(), nil
case grpcPluginStorageType:
case grpcStorageType:
return grpc.NewFactory(), nil
case blackholeStorageType:
return blackhole.NewFactory(), nil
Expand Down
9 changes: 8 additions & 1 deletion plugin/storage/factory_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ type FactoryConfig struct {
// * `memory` - built-in
// * `kafka` - built-in
// * `blackhole` - built-in
// * `plugin` - loads a dynamic plugin that implements storage.Factory interface (not supported at the moment)
// * `grpc` - build-in
//
// For backwards compatibility it also parses the args looking for deprecated --span-storage.type flag.
// If found, it writes a deprecation warning to the log.
Expand All @@ -66,6 +66,13 @@ func FactoryConfigFromEnvAndCLI(args []string, log io.Writer) FactoryConfig {
if spanStorageType == "" {
spanStorageType = cassandraStorageType
}
if spanStorageType == grpcPluginDeprecated {
fmt.Fprintf(log,
"WARNING: `%s` storage type is deprecated and will be remove from v1.60. Use `%s`.\n\n",
grpcPluginDeprecated, grpcStorageType,
)
spanStorageType = grpcStorageType
}
spanWriterTypes := strings.Split(spanStorageType, ",")
if len(spanWriterTypes) > 1 {
fmt.Fprintf(log,
Expand Down
4 changes: 2 additions & 2 deletions plugin/storage/grpc/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,14 @@ func (f *Factory) Initialize(metricsFactory metrics.Factory, logger *zap.Logger)

services, err := f.builder.Build(logger, f.tracerProvider)
if err != nil {
return fmt.Errorf("grpc-plugin builder failed to create a store: %w", err)
return fmt.Errorf("grpc storage builder failed to create a store: %w", err)
}

f.store = services.Store
f.archiveStore = services.ArchiveStore
f.capabilities = services.Capabilities
f.streamingSpanWriter = services.StreamingSpanWriter
logger.Info("External plugin storage configuration", zap.Any("configuration", f.options.Configuration))
logger.Info("Remote storage configuration", zap.Any("configuration", f.options.Configuration))
return nil
}

Expand Down
8 changes: 4 additions & 4 deletions scripts/generate-help-output.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function gen {
set -ex

gen agent nostorage
gen collector cassandra elasticsearch memory kafka badger grpc-plugin
gen query cassandra elasticsearch memory badger grpc-plugin
gen ingester cassandra elasticsearch memory badger grpc-plugin
gen all-in-one cassandra elasticsearch memory badger grpc-plugin
gen collector cassandra elasticsearch memory kafka badger grpc
gen query cassandra elasticsearch memory badger grpc
gen ingester cassandra elasticsearch memory badger grpc
gen all-in-one cassandra elasticsearch memory badger grpc

0 comments on commit 84ea40e

Please sign in to comment.