Skip to content

Commit

Permalink
Deprecate grpc-storage-plugin sidecar model (#4744)
Browse files Browse the repository at this point in the history
## Which problem is this PR solving?
- Part 1 of #4647

## Description of the changes
- Add deprecation notice to CLI flags
- Add log statement with deprecation notice

## How was this change tested?
```
$ SPAN_STORAGE_TYPE=grpc-plugin go run ./cmd/all-in-one help

      --grpc-storage-plugin.binary string                         (deprecated, will be removed after 2024-03-01) The location of the plugin binary
      --grpc-storage-plugin.configuration-file string             (deprecated, will be removed after 2024-03-01) A path pointing to the plugin's configuration file, made available to the plugin with the --config arg


$ SPAN_STORAGE_TYPE=grpc-plugin go run ./cmd/all-in-one --grpc-storage-plugin.binary=abcd

2023/09/10 00:39:38 (deprecated, will be removed after 2024-03-01) using sidecar model of grpc-plugin storage, please upgrade to 'reomte' gRPC storage. #4647

```

Signed-off-by: Yuri Shkuro <[email protected]>
  • Loading branch information
yurishkuro authored Sep 10, 2023
1 parent 8f680cc commit c8bcf28
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions plugin/storage/grpc/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package grpc
import (
"flag"
"fmt"
"log"
"time"

"github.com/spf13/viper"
Expand All @@ -35,6 +36,8 @@ const (
remoteConnectionTimeout = remotePrefix + ".connection-timeout"
defaultPluginLogLevel = "warn"
defaultConnectionTimeout = time.Duration(5 * time.Second)

deprecatedSidecar = "(deprecated, will be removed after 2024-03-01) "
)

// Options contains GRPC plugins configs and provides the ability
Expand All @@ -53,8 +56,8 @@ func tlsFlagsConfig() tlscfg.ClientFlagsConfig {
func (opt *Options) AddFlags(flagSet *flag.FlagSet) {
tlsFlagsConfig().AddFlags(flagSet)

flagSet.String(pluginBinary, "", "The location of the plugin binary")
flagSet.String(pluginConfigurationFile, "", "A path pointing to the plugin's configuration file, made available to the plugin with the --config arg")
flagSet.String(pluginBinary, "", deprecatedSidecar+"The location of the plugin binary")
flagSet.String(pluginConfigurationFile, "", deprecatedSidecar+"A path pointing to the plugin's configuration file, made available to the plugin with the --config arg")
flagSet.String(pluginLogLevel, defaultPluginLogLevel, "Set the log level of the plugin's logger")
flagSet.String(remoteServer, "", "The remote storage gRPC server address as host:port")
flagSet.Duration(remoteConnectionTimeout, defaultConnectionTimeout, "The remote storage gRPC server connection timeout")
Expand All @@ -73,5 +76,8 @@ func (opt *Options) InitFromViper(v *viper.Viper) error {
}
opt.Configuration.RemoteConnectTimeout = v.GetDuration(remoteConnectionTimeout)
opt.Configuration.TenancyOpts = tenancy.InitFromViper(v)
if opt.Configuration.PluginBinary != "" {
log.Printf(deprecatedSidecar + "using sidecar model of grpc-plugin storage, please upgrade to 'reomte' gRPC storage. https://github.com/jaegertracing/jaeger/issues/4647")
}
return nil
}

0 comments on commit c8bcf28

Please sign in to comment.