diff --git a/.gitignore b/.gitignore index 63cd11b81bd..73b86d9b398 100644 --- a/.gitignore +++ b/.gitignore @@ -17,7 +17,6 @@ cover.html vendor/ examples/hotrod/hotrod examples/hotrod/hotrod-* -examples/memstore-plugin/memstore-plugin cmd/all-in-one/all-in-one-* cmd/agent/agent cmd/agent/agent-* diff --git a/Makefile b/Makefile index 863b0c66718..2cbf176a7ad 100644 --- a/Makefile +++ b/Makefile @@ -139,7 +139,6 @@ badger-storage-integration-test: .PHONY: grpc-storage-integration-test grpc-storage-integration-test: - (cd examples/memstore-plugin/ && go build .) STORAGE=grpc $(MAKE) storage-integration-test # this test assumes STORAGE environment variable is set to elasticsearch|opensearch diff --git a/examples/memstore-plugin/README.md b/examples/memstore-plugin/README.md deleted file mode 100644 index 566e85c0978..00000000000 --- a/examples/memstore-plugin/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# memstore-plugin - -This package builds a binary that can be used as an example of a sidecar storage plugin. - -Note that Jaeger now supports remote storages via gRPC API, so using plugins is discouraged. -For example, `memorystore` can be used as a remote backend (https://github.com/jaegertracing/jaeger/issues/3835). diff --git a/examples/memstore-plugin/main.go b/examples/memstore-plugin/main.go deleted file mode 100644 index 097fdfcc17c..00000000000 --- a/examples/memstore-plugin/main.go +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) 2018 The Jaeger Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package main - -import ( - "context" - "flag" - "fmt" - "strings" - - "github.com/hashicorp/go-plugin" - "github.com/spf13/viper" - "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" - googleGRPC "google.golang.org/grpc" - - "github.com/jaegertracing/jaeger/pkg/jtracer" - "github.com/jaegertracing/jaeger/plugin/storage/grpc" - grpcMemory "github.com/jaegertracing/jaeger/plugin/storage/grpc/memory" - "github.com/jaegertracing/jaeger/plugin/storage/grpc/shared" - "github.com/jaegertracing/jaeger/plugin/storage/memory" -) - -const ( - serviceName = "mem-store" -) - -var configPath string - -func main() { - flag.StringVar(&configPath, "config", "", "A path to the plugin's configuration file") - flag.Parse() - - v := viper.New() - v.AutomaticEnv() - v.SetEnvKeyReplacer(strings.NewReplacer("-", "_", ".", "_")) - - if configPath != "" { - v.SetConfigFile(configPath) - if err := v.ReadInConfig(); err != nil { - panic(err) - } - } - - opts := memory.Options{} - opts.InitFromViper(v) - - tracer, err := jtracer.New(serviceName) - if err != nil { - panic(fmt.Errorf("failed to initialize tracer: %w", err)) - } - defer tracer.Close(context.Background()) - - memStorePlugin := grpcMemory.NewStoragePlugin(memory.NewStore(), memory.NewStore()) - service := &shared.PluginServices{ - Store: memStorePlugin, - ArchiveStore: memStorePlugin, - } - if v.GetBool("enable_streaming_writer") { - service.StreamingSpanWriter = memStorePlugin - } - grpc.ServeWithGRPCServer(service, func(options []googleGRPC.ServerOption) *googleGRPC.Server { - return plugin.DefaultGRPCServer([]googleGRPC.ServerOption{ - googleGRPC.StatsHandler(otelgrpc.NewServerHandler(otelgrpc.WithTracerProvider(tracer.OTEL))), - }) - }) -} diff --git a/plugin/storage/grpc/README.md b/plugin/storage/grpc/README.md index 1fee18db23a..86f1f41602f 100644 --- a/plugin/storage/grpc/README.md +++ b/plugin/storage/grpc/README.md @@ -1,23 +1,22 @@ -gRPC Storage Plugins -==================== +gRPC Remote Storage Plugins +=========================== -Update (Jan 2022): as of Jaeger v1.30, the gRPC storage extension can be implemented as a remote gRPC server, in addition to the gRPC plugin architecture described below. The remote server needs to implement the same `storage_v1` gRPC interfaces defined in `plugin/storage/grpc/proto/`. +Update (May 2024): as of v1.58, Jaeger will no longer support grpc-sidecar plugin model. Only gRPC Remote Storage API is suppored. -gRPC Storage Plugins currently use the [Hashicorp go-plugin](https://github.com/hashicorp/go-plugin). This requires the -implementer of a plugin to develop the "server" side of the go-plugin system. At a high level this looks like: +In order to support an ecosystem of different backend storage implementations, Jaeger supports a gRPC-based Remote Strorage API. The custom backend storage solutions need to implement `storage_v1` gRPC interfaces defined in `plugin/storage/grpc/proto/`. ``` +----------------------------------+ +-----------------------------+ | | | | -| +-------------+ | unix-socket | +-------------+ | +| +-------------+ | gRPC | +-------------+ | | | | | | | | | -| jaeger-component | grpc-client +----------------------> grpc-server | plugin-impl | +| jaeger-component | grpc-client +----------------------> grpc-server | custom impl | | | | | | | | | | +-------------+ | | +-------------+ | | | | | +----------------------------------+ +-----------------------------+ - parent process child sub-process + Jaeger official components Custom backend implementation ``` Implementing a plugin @@ -25,9 +24,9 @@ Implementing a plugin Although the instructions below are limited to Go, plugins can be implemented any language. Languages other than Go would implement a gRPC server using the `storage_v1` proto interfaces. The `proto` file can be found in `plugin/storage/grpc/proto/`. -To generate the bindings for your language you would use `protoc` with the appropriate `xx_out=` flag. This is detailed +To generate the bindings for your language you would use `protoc` with the appropriate `xx_out=` flag. This is detailed in the [protobuf documentation](https://developers.google.com/protocol-buffers/docs/tutorials) and you can see an example of -how it is done for Go in the top level Jaeger `Makefile`. +how it is done for Go in the top level Jaeger `Makefile`. The easiest way to generate the gRPC storage plugin bindings is to use [Docker Protobuf](https://github.com/jaegertracing/docker-protobuf/) which is a lightweight `protoc` Docker image containing the dependencies needed to generate code for multiple languages. For example, one can generate bindings for C# on Windows with Docker for Windows using the following steps: 1. First clone the Jaeger github repo to a folder (e.g. `c:\source\repos\jaeger`): @@ -40,79 +39,23 @@ $ git clone https://github.com/jaegertracing/jaeger.git c:\source\repos\jaeger ``` $ git submodule update --init --recursive ``` -3. Then execute the following Docker command which mounts the local directory `c:\source\repos\jaeger` to the directory `/jaeger` in the Docker container and then executes the `jaegertracing/protobuf:0.2.0` command. This will create a file called `Storage.cs` in your local Windows folder `c:\source\repos\jaeger\code` containing the gRPC Storage Plugin bindings. +3. Then execute the following Docker command which mounts the local directory `c:\source\repos\jaeger` to the directory `/jaeger` in the Docker container and then executes the `jaegertracing/protobuf:0.2.0` command. This will create a file called `Storage.cs` in your local Windows folder `c:\source\repos\jaeger\code` containing the gRPC Storage API bindings. ``` $ docker run --rm -u 1000 -v/c/source/repos/jaeger:/jaeger -w/jaeger \ jaegertracing/protobuf:0.2.0 "-I/jaeger -Iidl/proto/api_v2 -I/usr/include/github.com/gogo/protobuf -Iplugin/storage/grpc/proto --csharp_out=/jaeger/code plugin/storage/grpc/proto/storage.proto" ``` -There are instructions on implementing a `go-plugin` server for non-Go languages in the -[go-plugin non-go guide](https://github.com/hashicorp/go-plugin/blob/master/docs/guide-plugin-write-non-go.md). -Take note of the required [health check service](https://github.com/hashicorp/go-plugin/blob/master/docs/guide-plugin-write-non-go.md#3-add-the-grpc-health-checking-service). - -A Go plugin is a standalone application which calls `grpc.Serve(&pluginServices)` in its `main` function, where the `grpc` package -is `github.com/jaegertracing/jaeger/plugin/storage/grpc`. - -```go - package main - - import ( - "flag" - "github.com/jaegertracing/jaeger/plugin/storage/grpc" - ) - - func main() { - var configPath string - flag.StringVar(&configPath, "config", "", "A path to the plugin's configuration file") - flag.Parse() - - plugin := myStoragePlugin{} - - grpc.Serve(&shared.PluginServices{ - Store: plugin, - ArchiveStore: plugin, - }) - } -``` - -Note that `grpc.Serve` is called as the final part of the main. This should be called after you have carried out any necessary -setup for your plugin, as once running Jaeger may start calling to read/write spans straight away. You could defer -setup until the first read/write but that could make the first operation slow and also lead to racing behaviours. - -A plugin must implement the StoragePlugin interface of: - -```go -type StoragePlugin interface { - SpanReader() spanstore.Reader - SpanWriter() spanstore.Writer - DependencyReader() dependencystore.Reader -} -``` - -As your plugin will be dependent on the protobuf implementation within Jaeger you will likely need to `vendor` your -dependencies, you can also use `go.mod` to achieve the same goal of pinning your plugin to a Jaeger point in time. +An example of a Go binary that implements Remote Storage API can be found in `cmd/remote-storage`. That specific binary does not implement a custom backend, instead it supports the same backend implementations as available directly in Jaeger, but it makes them accessible via a Remote Storage API (and is being used in the integration tests). -A simple plugin which uses the memstore storage implementation can be found in the `examples` directory of the top level -of the Jaeger project. +The API consists of several gRPC services: + * `SpanReaderPlugin` - used for querying the data + * `SpanWriterPlugin` - used for writing data + * (optional) `StreamingSpanWriterPlugin` - allows more efficient transmission + * (optional) `ArchiveSpanWriterPlugin` and `ArchiveSpanReaderPlugin` - to support archiving storage + * (optional) `DependenciesReaderPlugin` - for reading service dependencies + * (optional) `PluginCapabilities` - can be interrogated to find out which services an implementation supports -To support archive storage a plugin must implement the ArchiveStoragePlugin interface of: - -```go -type ArchiveStoragePlugin interface { - ArchiveSpanReader() spanstore.Reader - ArchiveSpanWriter() spanstore.Writer -} -``` - -If you don't plan to implement archive storage simply do not fill `ArchiveStore` property of `shared.PluginServices`: - -```go -grpc.Serve(&shared.PluginServices{ - Store: plugin, -}) -``` - -The plugin framework supports writing spans via gRPC stream, instead of unary messages. Streaming writes can improve throughput and decrease CPU load (see benchmarks in Issue #3636). The plugin needs to implement `StreamingSpanWriter` interface and indicate support via the `streamingSpanWriter` flag in the `Capabilities` response. +The API supports writing spans via gRPC stream, instead of unary messages. Streaming writes can improve throughput and decrease CPU load (see benchmarks in Issue #3636). The backend needs to implement `StreamingSpanWriterPlugin` service and indicate support via the `streamingSpanWriter` flag in the `Capabilities` response. Note that using the streaming spanWriter may make the collector's `save_by_svr` metric inaccurate, in which case users will need to pay attention to the metrics provided by the plugin. @@ -141,72 +84,15 @@ func TestJaegerStorageIntegration(t *testing.T) { ``` For more details, refer to one of the following implementations. -1. [grpc-plugin](https://github.com/jaegertracing/jaeger/blob/cbceceb1e0cc308cdf0226b1fa19b9c531a3a2d3/plugin/storage/integration/grpc_test.go#L189-L203) -2. [jaeger-clickhouse](https://github.com/jaegertracing/jaeger-clickhouse/blob/798c568c1e1a345536f35692fca71196a796811e/integration/grpc_test.go#L88-L107) -3. [Timescale DB via Promscale](https://github.com/timescale/promscale/blob/ccde8accf5205450891e805e23566d9a11dbf8d3/pkg/tests/end_to_end_tests/jaeger_store_integration_test.go#L79-L97) - -Running with a plugin ---------------------- -A plugin can be run using the `all-in-one` application within the top level `cmd` package of the Jaeger project. To do this -an environment variable must be set to tell the `all-in-one` application to use the gRPC plugin storage: -`export SPAN_STORAGE_TYPE="grpc-plugin"` - -Once this has been set then there are two command line flags that can be used to configure the plugin. The first is -`--grpc-storage-plugin.binary` which is required and is the path to the plugin **binary**. The second is -`--grpc-storage-plugin.configuration-file` which is optional and is the path to the configuration file which will be -provided to your plugin as a command line flag. This command line flag is `config`, as can be seen in the code sample -above. An example invocation would be: - -``` -./all-in-one --grpc-storage-plugin.binary=/path/to/my/plugin --grpc-storage-plugin.configuration-file=/path/to/my/config -``` - -As well as passing configuration values via the command line through the configuration file it is also possible to use -environment variables. When you invoke `all-in-one` any environment variables that have been set will also be accessible -from within your plugin, this is useful if using Docker. - -Logging -------- -In order for Jaeger to include the log output from your plugin you need to use `hclog` (`"github.com/hashicorp/go-hclog"`). -The plugin framework will only include any log output created at the `WARN` or above levels. If you log output in this -way before calling `grpc.Serve` then it will still be included in the Jaeger output. - -An example logger instantiation could look like: - - ``` -logger := hclog.New(&hclog.LoggerOptions{ - Level: hclog.Warn, - Name: "my-jaeger-plugin", - JSONFormat: true, -}) -``` - -There are more logger options that can be used with `hclog` listed on [godoc](https://godoc.org/github.com/hashicorp/go-hclog#LoggerOptions). - -Note: Setting the `Output` option to `os.Stdout` can confuse the `go-plugin` framework and lead it to consider the plugin -errored. +1. [jaeger-clickhouse](https://github.com/jaegertracing/jaeger-clickhouse/blob/798c568c1e1a345536f35692fca71196a796811e/integration/grpc_test.go#L88-L107) +2. [Timescale DB via Promscale](https://github.com/timescale/promscale/blob/ccde8accf5205450891e805e23566d9a11dbf8d3/pkg/tests/end_to_end_tests/jaeger_store_integration_test.go#L79-L97) Tracing ------- -When `grpc-plugin` is used, it will be running as a separated process, thus context propagation is necessary for inter-process scenarios. - -In order to get complete traces containing both `jaeger-component`(s) and the `grpc-plugin`, developers should enable tracing at server-side. -Thus, we can leverage gRPC interceptors, - -```golang -grpc.ServeWithGRPCServer(&shared.PluginServices{ - Store: memStorePlugin, - ArchiveStore: memStorePlugin, -}, func(options []googleGRPC.ServerOption) *googleGRPC.Server { - return plugin.DefaultGRPCServer([]googleGRPC.ServerOption{ - grpc.UnaryInterceptor(otelgrpc.UnaryServerInterceptor(otelgrpc.WithTracerProvider(tracerProvider))), - grpc.StreamInterceptor(otelgrpc.StreamServerInterceptor(otelgrpc.WithTracerProvider(tracerProvider))), - }) -}) -``` +Jaeger requests to the backend implementation will include standard OTEL tracing headers. The implementation may choose to participate in those traces to allow end to end visibility of Jaeger's own operations (typically only enabled for read requests, +as tracing write requests results in traces for traces and may cause infinite loops). -Refer to `example/memstore-plugin` for more details. Bearer token propagation from the UI ------------------------------------ diff --git a/plugin/storage/grpc/config/config.go b/plugin/storage/grpc/config/config.go index fe96ee35582..a4f5c03035c 100644 --- a/plugin/storage/grpc/config/config.go +++ b/plugin/storage/grpc/config/config.go @@ -1,7 +1,7 @@ // Copyright (c) 2019 The Jaeger Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. +// you may not use this file ex cept in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 @@ -15,12 +15,10 @@ package config import ( + "errors" "fmt" - "os/exec" "time" - "github.com/hashicorp/go-hclog" - "github.com/hashicorp/go-plugin" "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" @@ -33,39 +31,24 @@ import ( "github.com/jaegertracing/jaeger/plugin/storage/grpc/shared" ) -var pluginHealthCheckInterval = time.Second * 60 - // Configuration describes the options to customize the storage behavior. type Configuration struct { - PluginBinary string `yaml:"binary" mapstructure:"binary"` - PluginConfigurationFile string `yaml:"configuration-file" mapstructure:"configuration_file"` - PluginLogLevel string `yaml:"log-level" mapstructure:"log_level"` - RemoteServerAddr string `yaml:"server" mapstructure:"server"` - RemoteTLS tlscfg.Options - RemoteConnectTimeout time.Duration `yaml:"connection-timeout" mapstructure:"connection-timeout"` - TenancyOpts tenancy.Options + RemoteServerAddr string `yaml:"server" mapstructure:"server"` + RemoteTLS tlscfg.Options + RemoteConnectTimeout time.Duration `yaml:"connection-timeout" mapstructure:"connection-timeout"` + TenancyOpts tenancy.Options - pluginHealthCheck *time.Ticker - pluginHealthCheckDone chan bool - pluginRPCClient plugin.ClientProtocol - remoteConn *grpc.ClientConn + remoteConn *grpc.ClientConn } // ClientPluginServices defines services plugin can expose and its capabilities type ClientPluginServices struct { shared.PluginServices - Capabilities shared.PluginCapabilities - killPluginClient func() -} - -func (c *ClientPluginServices) Close() error { - if c.killPluginClient != nil { - c.killPluginClient() - } - return nil + Capabilities shared.PluginCapabilities } // PluginBuilder is used to create storage plugins. Implemented by Configuration. +// TODO this interface should be removed and the building capability moved to Factory. type PluginBuilder interface { Build(logger *zap.Logger, tracerProvider trace.TracerProvider) (*ClientPluginServices, error) Close() error @@ -73,23 +56,7 @@ type PluginBuilder interface { // Build instantiates a PluginServices func (c *Configuration) Build(logger *zap.Logger, tracerProvider trace.TracerProvider) (*ClientPluginServices, error) { - if c.PluginBinary != "" { - return c.buildPlugin(logger, tracerProvider) - } else { - return c.buildRemote(logger, tracerProvider, grpc.NewClient) - } -} - -func (c *Configuration) Close() error { - if c.pluginHealthCheck != nil { - c.pluginHealthCheck.Stop() - c.pluginHealthCheckDone <- true - } - if c.remoteConn != nil { - c.remoteConn.Close() - } - - return c.RemoteTLS.Close() + return c.buildRemote(logger, tracerProvider, grpc.NewClient) } type newClientFn func(target string, opts ...grpc.DialOption) (conn *grpc.ClientConn, err error) @@ -132,96 +99,11 @@ func (c *Configuration) buildRemote(logger *zap.Logger, tracerProvider trace.Tra }, nil } -func (c *Configuration) buildPlugin(logger *zap.Logger, tracerProvider trace.TracerProvider) (*ClientPluginServices, error) { - opts := []grpc.DialOption{ - grpc.WithStatsHandler(otelgrpc.NewClientHandler(otelgrpc.WithTracerProvider(tracerProvider))), - } - - tenancyMgr := tenancy.NewManager(&c.TenancyOpts) - if tenancyMgr.Enabled { - opts = append(opts, grpc.WithUnaryInterceptor(tenancy.NewClientUnaryInterceptor(tenancyMgr))) - opts = append(opts, grpc.WithStreamInterceptor(tenancy.NewClientStreamInterceptor(tenancyMgr))) - } - - // #nosec G204 - cmd := exec.Command(c.PluginBinary, "--config", c.PluginConfigurationFile) - client := plugin.NewClient(&plugin.ClientConfig{ - HandshakeConfig: shared.Handshake, - VersionedPlugins: map[int]plugin.PluginSet{ - 1: shared.PluginMap, - }, - Cmd: cmd, - AllowedProtocols: []plugin.Protocol{plugin.ProtocolGRPC}, - Logger: hclog.New(&hclog.LoggerOptions{ - Level: hclog.LevelFromString(c.PluginLogLevel), - }), - GRPCDialOptions: opts, - }) - - rpcClient, err := client.Client() - if err != nil { - return nil, fmt.Errorf("error attempting to connect to plugin rpc client: %w", err) - } - - raw, err := rpcClient.Dispense(shared.StoragePluginIdentifier) - if err != nil { - return nil, fmt.Errorf("unable to retrieve storage plugin instance: %w", err) - } - - // in practice, the type of `raw` is *shared.grpcClient, and type casts below cannot fail - storagePlugin, ok := raw.(shared.StoragePlugin) - if !ok { - return nil, fmt.Errorf("unable to cast %T to shared.StoragePlugin for plugin \"%s\"", - raw, shared.StoragePluginIdentifier) - } - archiveStoragePlugin, ok := raw.(shared.ArchiveStoragePlugin) - if !ok { - return nil, fmt.Errorf("unable to cast %T to shared.ArchiveStoragePlugin for plugin \"%s\"", - raw, shared.StoragePluginIdentifier) - } - streamingSpanWriterPlugin, ok := raw.(shared.StreamingSpanWriterPlugin) - if !ok { - return nil, fmt.Errorf("unable to cast %T to shared.StreamingSpanWriterPlugin for plugin \"%s\"", - raw, shared.StoragePluginIdentifier) - } - capabilities, ok := raw.(shared.PluginCapabilities) - if !ok { - return nil, fmt.Errorf("unable to cast %T to shared.PluginCapabilities for plugin \"%s\"", - raw, shared.StoragePluginIdentifier) - } - - if err := c.startPluginHealthCheck(rpcClient, logger); err != nil { - return nil, fmt.Errorf("initial plugin health check failed: %w", err) +func (c *Configuration) Close() error { + var errs []error + if c.remoteConn != nil { + errs = append(errs, c.remoteConn.Close()) } - - return &ClientPluginServices{ - PluginServices: shared.PluginServices{ - Store: storagePlugin, - ArchiveStore: archiveStoragePlugin, - StreamingSpanWriter: streamingSpanWriterPlugin, - }, - Capabilities: capabilities, - killPluginClient: client.Kill, - }, nil -} - -func (c *Configuration) startPluginHealthCheck(rpcClient plugin.ClientProtocol, logger *zap.Logger) error { - c.pluginRPCClient = rpcClient - c.pluginHealthCheckDone = make(chan bool) - c.pluginHealthCheck = time.NewTicker(pluginHealthCheckInterval) - - go func() { - for { - select { - case <-c.pluginHealthCheckDone: - return - case <-c.pluginHealthCheck.C: - if err := c.pluginRPCClient.Ping(); err != nil { - logger.Fatal("plugin health check failed", zap.Error(err)) - } - } - } - }() - - return c.pluginRPCClient.Ping() + errs = append(errs, c.RemoteTLS.Close()) + return errors.Join(errs...) } diff --git a/plugin/storage/grpc/factory.go b/plugin/storage/grpc/factory.go index e5ae279541d..8458b1bf6b1 100644 --- a/plugin/storage/grpc/factory.go +++ b/plugin/storage/grpc/factory.go @@ -15,7 +15,6 @@ package grpc import ( - "errors" "flag" "fmt" "io" @@ -54,8 +53,6 @@ type Factory struct { archiveStore shared.ArchiveStoragePlugin streamingSpanWriter shared.StreamingSpanWriterPlugin capabilities shared.PluginCapabilities - - servicesCloser io.Closer } // NewFactory creates a new Factory. @@ -111,7 +108,6 @@ func (f *Factory) Initialize(metricsFactory metrics.Factory, logger *zap.Logger) f.archiveStore = services.ArchiveStore f.capabilities = services.Capabilities f.streamingSpanWriter = services.StreamingSpanWriter - f.servicesCloser = services logger.Info("External plugin storage configuration", zap.Any("configuration", f.options.Configuration)) return nil } @@ -168,10 +164,6 @@ func (f *Factory) CreateArchiveSpanWriter() (spanstore.Writer, error) { // Close closes the resources held by the factory func (f *Factory) Close() error { - errs := []error{} - if f.servicesCloser != nil { - errs = append(errs, f.servicesCloser.Close()) - } - errs = append(errs, f.builder.Close()) - return errors.Join(errs...) + // TODO Close should move into Services type, instead of being in the Config. + return f.builder.Close() } diff --git a/plugin/storage/grpc/factory_test.go b/plugin/storage/grpc/factory_test.go index 3d357a1346d..71270cdc4ff 100644 --- a/plugin/storage/grpc/factory_test.go +++ b/plugin/storage/grpc/factory_test.go @@ -301,15 +301,11 @@ func TestWithConfiguration(t *testing.T) { f := NewFactory() v, command := config.Viperize(f.AddFlags) err := command.ParseFlags([]string{ - "--grpc-storage-plugin.log-level=debug", - "--grpc-storage-plugin.binary=noop-grpc-plugin", - "--grpc-storage-plugin.configuration-file=config.json", + "--grpc-storage.server=foo:1234", }) require.NoError(t, err) f.InitFromViper(v, zap.NewNop()) - assert.Equal(t, "noop-grpc-plugin", f.options.Configuration.PluginBinary) - assert.Equal(t, "config.json", f.options.Configuration.PluginConfigurationFile) - assert.Equal(t, "debug", f.options.Configuration.PluginLogLevel) + assert.Equal(t, "foo:1234", f.options.Configuration.RemoteServerAddr) require.NoError(t, f.Close()) } @@ -317,7 +313,7 @@ func TestConfigureFromOptions(t *testing.T) { f := Factory{} o := Options{ Configuration: grpcConfig.Configuration{ - PluginLogLevel: "info", + RemoteServerAddr: "foo:1234", }, } f.configureFromOptions(o) diff --git a/plugin/storage/grpc/grpc.go b/plugin/storage/grpc/grpc.go deleted file mode 100644 index 09ffffcd399..00000000000 --- a/plugin/storage/grpc/grpc.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2019 The Jaeger Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package grpc - -import ( - "github.com/hashicorp/go-plugin" - "google.golang.org/grpc" - - "github.com/jaegertracing/jaeger/plugin/storage/grpc/shared" -) - -// Serve creates a plugin configuration using the implementation of StoragePlugin and then serves it. -func Serve(services *shared.PluginServices) { - ServeWithGRPCServer(services, plugin.DefaultGRPCServer) -} - -// ServeWithGRPCServer creates a plugin configuration using the implementation of StoragePlugin and -// function to create grpcServer, and then serves it. -func ServeWithGRPCServer(services *shared.PluginServices, grpcServer func([]grpc.ServerOption) *grpc.Server, -) { - plugin.Serve(&plugin.ServeConfig{ - HandshakeConfig: shared.Handshake, - VersionedPlugins: map[int]plugin.PluginSet{ - 1: map[string]plugin.Plugin{ - shared.StoragePluginIdentifier: &shared.StorageGRPCPlugin{ - Impl: services.Store, - ArchiveImpl: services.ArchiveStore, - StreamImpl: services.StreamingSpanWriter, - }, - }, - }, - GRPCServer: grpcServer, - }) -} diff --git a/plugin/storage/grpc/memory/plugin.go b/plugin/storage/grpc/memory/plugin.go deleted file mode 100644 index bda596e9684..00000000000 --- a/plugin/storage/grpc/memory/plugin.go +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) 2020 The Jaeger Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package memory - -import ( - "github.com/jaegertracing/jaeger/plugin/storage/grpc/shared" - "github.com/jaegertracing/jaeger/plugin/storage/memory" - "github.com/jaegertracing/jaeger/storage/dependencystore" - "github.com/jaegertracing/jaeger/storage/spanstore" -) - -var ( - _ shared.StoragePlugin = (*storagePlugin)(nil) - _ shared.ArchiveStoragePlugin = (*storagePlugin)(nil) - _ shared.StreamingSpanWriterPlugin = (*storagePlugin)(nil) -) - -type storagePlugin struct { - store *memory.Store - archiveStore *memory.Store -} - -func NewStoragePlugin(mainStore *memory.Store, archiveStore *memory.Store) *storagePlugin { - return &storagePlugin{store: mainStore, archiveStore: archiveStore} -} - -func (ns *storagePlugin) DependencyReader() dependencystore.Reader { - return ns.store -} - -func (ns *storagePlugin) SpanReader() spanstore.Reader { - return ns.store -} - -func (ns *storagePlugin) SpanWriter() spanstore.Writer { - return ns.store -} - -func (ns *storagePlugin) StreamingSpanWriter() spanstore.Writer { - return ns.store -} - -func (ns *storagePlugin) ArchiveSpanReader() spanstore.Reader { - return ns.archiveStore -} - -func (ns *storagePlugin) ArchiveSpanWriter() spanstore.Writer { - return ns.archiveStore -} diff --git a/plugin/storage/grpc/memory/plugin_test.go b/plugin/storage/grpc/memory/plugin_test.go deleted file mode 100644 index 7f9501ce29a..00000000000 --- a/plugin/storage/grpc/memory/plugin_test.go +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) 2019 The Jaeger Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package memory - -import ( - "testing" - - "github.com/stretchr/testify/assert" - - "github.com/jaegertracing/jaeger/pkg/testutils" - "github.com/jaegertracing/jaeger/plugin/storage/memory" -) - -func TestPluginUsesMemoryStorage(t *testing.T) { - mainStorage := memory.NewStore() - archiveStorage := memory.NewStore() - - memStorePlugin := NewStoragePlugin(mainStorage, archiveStorage) - - assert.Equal(t, mainStorage, memStorePlugin.DependencyReader()) - assert.Equal(t, mainStorage, memStorePlugin.SpanReader()) - assert.Equal(t, mainStorage, memStorePlugin.SpanWriter()) - assert.Equal(t, mainStorage, memStorePlugin.StreamingSpanWriter()) - assert.Equal(t, archiveStorage, memStorePlugin.ArchiveSpanReader()) - assert.Equal(t, archiveStorage, memStorePlugin.ArchiveSpanWriter()) -} - -func TestMain(m *testing.M) { - testutils.VerifyGoLeaks(m) -} diff --git a/plugin/storage/grpc/options.go b/plugin/storage/grpc/options.go index b3b8d9210b2..bfefabd43a6 100644 --- a/plugin/storage/grpc/options.go +++ b/plugin/storage/grpc/options.go @@ -17,7 +17,6 @@ package grpc import ( "flag" "fmt" - "log" "time" "github.com/spf13/viper" @@ -28,16 +27,10 @@ import ( ) const ( - pluginBinary = "grpc-storage-plugin.binary" - pluginConfigurationFile = "grpc-storage-plugin.configuration-file" - pluginLogLevel = "grpc-storage-plugin.log-level" remotePrefix = "grpc-storage" remoteServer = remotePrefix + ".server" 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 @@ -56,18 +49,12 @@ func tlsFlagsConfig() tlscfg.ClientFlagsConfig { func (opt *Options) AddFlags(flagSet *flag.FlagSet) { tlsFlagsConfig().AddFlags(flagSet) - 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") } // InitFromViper initializes Options with properties from viper func (opt *Options) InitFromViper(v *viper.Viper) error { - opt.Configuration.PluginBinary = v.GetString(pluginBinary) - opt.Configuration.PluginConfigurationFile = v.GetString(pluginConfigurationFile) - opt.Configuration.PluginLogLevel = v.GetString(pluginLogLevel) opt.Configuration.RemoteServerAddr = v.GetString(remoteServer) var err error opt.Configuration.RemoteTLS, err = tlsFlagsConfig().InitFromViper(v) @@ -76,8 +63,5 @@ 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 'remote' gRPC storage. https://github.com/jaegertracing/jaeger/issues/4647") - } return nil } diff --git a/plugin/storage/grpc/options_test.go b/plugin/storage/grpc/options_test.go index a72bb9eeb81..dce4e35d3ad 100644 --- a/plugin/storage/grpc/options_test.go +++ b/plugin/storage/grpc/options_test.go @@ -29,17 +29,13 @@ func TestOptionsWithFlags(t *testing.T) { opts := &Options{} v, command := config.Viperize(opts.AddFlags, tenancy.AddFlags) err := command.ParseFlags([]string{ - "--grpc-storage-plugin.binary=noop-grpc-plugin", - "--grpc-storage-plugin.configuration-file=config.json", - "--grpc-storage-plugin.log-level=debug", + "--grpc-storage.server=foo:12345", "--multi-tenancy.header=x-scope-orgid", }) require.NoError(t, err) opts.InitFromViper(v) - assert.Equal(t, "noop-grpc-plugin", opts.Configuration.PluginBinary) - assert.Equal(t, "config.json", opts.Configuration.PluginConfigurationFile) - assert.Equal(t, "debug", opts.Configuration.PluginLogLevel) + assert.Equal(t, "foo:12345", opts.Configuration.RemoteServerAddr) assert.False(t, opts.Configuration.TenancyOpts.Enabled) assert.Equal(t, "x-scope-orgid", opts.Configuration.TenancyOpts.Header) } @@ -55,7 +51,6 @@ func TestRemoteOptionsWithFlags(t *testing.T) { require.NoError(t, err) opts.InitFromViper(v) - assert.Equal(t, "", opts.Configuration.PluginBinary) assert.Equal(t, "localhost:2001", opts.Configuration.RemoteServerAddr) assert.True(t, opts.Configuration.RemoteTLS.Enabled) assert.Equal(t, 60*time.Second, opts.Configuration.RemoteConnectTimeout) @@ -72,7 +67,6 @@ func TestRemoteOptionsNoTLSWithFlags(t *testing.T) { require.NoError(t, err) opts.InitFromViper(v) - assert.Equal(t, "", opts.Configuration.PluginBinary) assert.Equal(t, "localhost:2001", opts.Configuration.RemoteServerAddr) assert.False(t, opts.Configuration.RemoteTLS.Enabled) assert.Equal(t, 60*time.Second, opts.Configuration.RemoteConnectTimeout) diff --git a/plugin/storage/grpc/shared/grpc_client.go b/plugin/storage/grpc/shared/grpc_client.go index 9b24b6c18eb..cb8693f950b 100644 --- a/plugin/storage/grpc/shared/grpc_client.go +++ b/plugin/storage/grpc/shared/grpc_client.go @@ -28,6 +28,7 @@ import ( "github.com/jaegertracing/jaeger/model" "github.com/jaegertracing/jaeger/pkg/bearertoken" + _ "github.com/jaegertracing/jaeger/pkg/gogocodec" // force gogo codec registration "github.com/jaegertracing/jaeger/proto-gen/storage_v1" "github.com/jaegertracing/jaeger/storage/dependencystore" "github.com/jaegertracing/jaeger/storage/spanstore" diff --git a/plugin/storage/grpc/shared/grpc_handler.go b/plugin/storage/grpc/shared/grpc_handler.go index 98f27a53540..e19484b09e4 100644 --- a/plugin/storage/grpc/shared/grpc_handler.go +++ b/plugin/storage/grpc/shared/grpc_handler.go @@ -25,6 +25,7 @@ import ( "google.golang.org/grpc/status" "github.com/jaegertracing/jaeger/model" + _ "github.com/jaegertracing/jaeger/pkg/gogocodec" // force gogo codec registration "github.com/jaegertracing/jaeger/proto-gen/storage_v1" "github.com/jaegertracing/jaeger/storage/dependencystore" "github.com/jaegertracing/jaeger/storage/spanstore" diff --git a/plugin/storage/grpc/shared/interface.go b/plugin/storage/grpc/shared/interface.go index c6345a29b82..ac3e5275d3e 100644 --- a/plugin/storage/grpc/shared/interface.go +++ b/plugin/storage/grpc/shared/interface.go @@ -15,26 +15,10 @@ package shared import ( - "github.com/hashicorp/go-plugin" - "github.com/jaegertracing/jaeger/storage/dependencystore" "github.com/jaegertracing/jaeger/storage/spanstore" ) -// StoragePluginIdentifier is the identifier that is shared by plugin and host. -const StoragePluginIdentifier = "storage_plugin" - -// Handshake is a common handshake that is shared by plugin and host. -var Handshake = plugin.HandshakeConfig{ - MagicCookieKey: "STORAGE_PLUGIN", - MagicCookieValue: "jaeger", -} - -// PluginMap is the map of plugins we can dispense. -var PluginMap = map[string]plugin.Plugin{ - StoragePluginIdentifier: &StorageGRPCPlugin{}, -} - // StoragePlugin is the interface we're exposing as a plugin. type StoragePlugin interface { SpanReader() spanstore.Reader diff --git a/plugin/storage/grpc/shared/plugin.go b/plugin/storage/grpc/shared/plugin.go deleted file mode 100644 index b4a3fabf93e..00000000000 --- a/plugin/storage/grpc/shared/plugin.go +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) 2020 The Jaeger Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package shared - -import ( - "context" - - "github.com/hashicorp/go-plugin" - "google.golang.org/grpc" - - _ "github.com/jaegertracing/jaeger/pkg/gogocodec" // force gogo codec registration -) - -// Ensure plugin.GRPCPlugin API match. -var _ plugin.GRPCPlugin = (*StorageGRPCPlugin)(nil) - -// StorageGRPCPlugin is the implementation of plugin.GRPCPlugin. -type StorageGRPCPlugin struct { - plugin.Plugin - - // Concrete implementation, This is only used for plugins that are written in Go. - Impl StoragePlugin - ArchiveImpl ArchiveStoragePlugin - StreamImpl StreamingSpanWriterPlugin -} - -// RegisterHandlers registers the plugin with the server -func (p *StorageGRPCPlugin) RegisterHandlers(s *grpc.Server) error { - handler := NewGRPCHandlerWithPlugins(p.Impl, p.ArchiveImpl, p.StreamImpl) - return handler.Register(s) -} - -// GRPCServer implements plugin.GRPCPlugin. It is used by go-plugin to create a grpc plugin server. -func (p *StorageGRPCPlugin) GRPCServer(_ *plugin.GRPCBroker, s *grpc.Server) error { - return p.RegisterHandlers(s) -} - -// GRPCClient implements plugin.GRPCPlugin. It is used by go-plugin to create a grpc plugin client. -func (*StorageGRPCPlugin) GRPCClient(_ context.Context, _ *plugin.GRPCBroker, conn *grpc.ClientConn) (interface{}, error) { - return NewGRPCClient(conn), nil -} diff --git a/plugin/storage/grpc/shared/plugin_test.go b/plugin/storage/grpc/shared/plugin_test.go deleted file mode 100644 index 3f143b773d4..00000000000 --- a/plugin/storage/grpc/shared/plugin_test.go +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) 2024 The Jaeger Authors. -// SPDX-License-Identifier: Apache-2.0 - -package shared - -import ( - "context" - "testing" - - "github.com/stretchr/testify/require" - "google.golang.org/grpc" - - "github.com/jaegertracing/jaeger/storage/dependencystore" - dependencyStoreMocks "github.com/jaegertracing/jaeger/storage/dependencystore/mocks" - "github.com/jaegertracing/jaeger/storage/spanstore" - spanStoreMocks "github.com/jaegertracing/jaeger/storage/spanstore/mocks" -) - -type mockStorageGRPCPlugin struct { - spanReader *spanStoreMocks.Reader - spanWriter *spanStoreMocks.Writer - depsReader *dependencyStoreMocks.Reader -} - -type mockArchiveStoragePlugin struct { - archiveReader *spanStoreMocks.Reader - archiveWriter *spanStoreMocks.Writer -} - -type mockStreamingSpanWriterPlugin struct { - streamWriter *spanStoreMocks.Writer -} - -func (plugin *mockArchiveStoragePlugin) ArchiveSpanReader() spanstore.Reader { - return plugin.archiveReader -} - -func (plugin *mockArchiveStoragePlugin) ArchiveSpanWriter() spanstore.Writer { - return plugin.archiveWriter -} - -func (plugin *mockStorageGRPCPlugin) SpanReader() spanstore.Reader { - return plugin.spanReader -} - -func (plugin *mockStorageGRPCPlugin) SpanWriter() spanstore.Writer { - return plugin.spanWriter -} - -func (plugin *mockStorageGRPCPlugin) DependencyReader() dependencystore.Reader { - return plugin.depsReader -} - -func (plugin *mockStreamingSpanWriterPlugin) StreamingSpanWriter() spanstore.Writer { - return plugin.streamWriter -} - -func TestStorageGRPCPlugin_RegisterHandlers(t *testing.T) { - plugin := StorageGRPCPlugin{ - Impl: &mockStorageGRPCPlugin{}, - ArchiveImpl: &mockArchiveStoragePlugin{}, - StreamImpl: &mockStreamingSpanWriterPlugin{}, - } - server := grpc.NewServer() - err := plugin.RegisterHandlers(server) - require.NoError(t, err) -} - -func TestStorageGRPCPlugin_GRPCServer(t *testing.T) { - plugin := &StorageGRPCPlugin{ - Impl: &mockStoragePlugin{}, - ArchiveImpl: &mockArchiveStoragePlugin{}, - StreamImpl: &mockStreamingSpanWriterPlugin{}, - } - server := grpc.NewServer() - err := plugin.GRPCServer(nil, server) - require.NoError(t, err) -} - -func TestStorageGRPCPlugin_GRPCClient(t *testing.T) { - clientConn := &grpc.ClientConn{} - plugin := &StorageGRPCPlugin{} - _, err := plugin.GRPCClient(context.Background(), nil, clientConn) - require.NoError(t, err) -} diff --git a/plugin/storage/integration/grpc_test.go b/plugin/storage/integration/grpc_test.go index f7d7bafbb42..8b6c24c9f6d 100644 --- a/plugin/storage/integration/grpc_test.go +++ b/plugin/storage/integration/grpc_test.go @@ -16,12 +16,9 @@ package integration import ( - "os" - "path" "testing" "github.com/stretchr/testify/require" - "go.uber.org/zap" "go.uber.org/zap/zaptest" "github.com/jaegertracing/jaeger/pkg/config" @@ -29,25 +26,16 @@ import ( "github.com/jaegertracing/jaeger/plugin/storage/grpc" ) -const ( - defaultPluginBinaryPath = "../../../examples/memstore-plugin/memstore-plugin" - streamingPluginConfigPath = "fixtures/grpc_plugin_conf.yaml" -) - type GRPCStorageIntegrationTestSuite struct { StorageIntegration - flags []string - factory *grpc.Factory - useRemoteStorage bool - remoteStorage *RemoteMemoryStorage + flags []string + factory *grpc.Factory + remoteStorage *RemoteMemoryStorage } func (s *GRPCStorageIntegrationTestSuite) initialize(t *testing.T) { - logger := zaptest.NewLogger(t, zaptest.Level(zap.DebugLevel)) - - if s.useRemoteStorage { - s.remoteStorage = StartNewRemoteMemoryStorage(t) - } + logger := zaptest.NewLogger(t) + s.remoteStorage = StartNewRemoteMemoryStorage(t) f := grpc.NewFactory() v, command := config.Viperize(f.AddFlags) @@ -73,9 +61,7 @@ func (s *GRPCStorageIntegrationTestSuite) initialize(t *testing.T) { func (s *GRPCStorageIntegrationTestSuite) close(t *testing.T) { require.NoError(t, s.factory.Close()) - if s.useRemoteStorage { - s.remoteStorage.Close(t) - } + s.remoteStorage.Close(t) } func (s *GRPCStorageIntegrationTestSuite) cleanUp(t *testing.T) { @@ -83,63 +69,13 @@ func (s *GRPCStorageIntegrationTestSuite) cleanUp(t *testing.T) { s.initialize(t) } -func getPluginFlags(t *testing.T) []string { - binaryPath := os.Getenv("PLUGIN_BINARY_PATH") - if binaryPath == "" { - t.Logf("PLUGIN_BINARY_PATH env var not set, using %s", defaultPluginBinaryPath) - binaryPath = defaultPluginBinaryPath - } - - return []string{ - "--grpc-storage-plugin.binary", binaryPath, - "--grpc-storage-plugin.log-level", "debug", - } -} - -func TestGRPCStorage(t *testing.T) { - SkipUnlessEnv(t, "grpc") - flags := getPluginFlags(t) - if configPath := os.Getenv("PLUGIN_CONFIG_PATH"); configPath == "" { - t.Log("PLUGIN_CONFIG_PATH env var not set") - } else { - flags = append(flags, "--grpc-storage-plugin.configuration-file", configPath) - } - - s := &GRPCStorageIntegrationTestSuite{ - flags: flags, - } - s.initialize(t) - defer s.close(t) - s.RunAll(t) -} - -func TestGRPCStreamingWriter(t *testing.T) { - SkipUnlessEnv(t, "grpc") - flags := getPluginFlags(t) - wd, err := os.Getwd() - require.NoError(t, err) - flags = append(flags, - "--grpc-storage-plugin.configuration-file", - path.Join(wd, streamingPluginConfigPath)) - - s := &GRPCStorageIntegrationTestSuite{ - flags: flags, - } - s.initialize(t) - defer s.close(t) - s.RunAll(t) -} - func TestGRPCRemoteStorage(t *testing.T) { SkipUnlessEnv(t, "grpc") - flags := []string{ - "--grpc-storage.server=localhost:17271", - "--grpc-storage.tls.enabled=false", - } - s := &GRPCStorageIntegrationTestSuite{ - flags: flags, - useRemoteStorage: true, + flags: []string{ + "--grpc-storage.server=localhost:17271", + "--grpc-storage.tls.enabled=false", + }, } s.initialize(t) defer s.close(t) diff --git a/plugin/storage/integration/remote_memory_storage.go b/plugin/storage/integration/remote_memory_storage.go index 5bb133771e2..3ce5bf3d4d8 100644 --- a/plugin/storage/integration/remote_memory_storage.go +++ b/plugin/storage/integration/remote_memory_storage.go @@ -8,7 +8,6 @@ import ( "testing" "github.com/stretchr/testify/require" - "go.uber.org/zap" "go.uber.org/zap/zaptest" "github.com/jaegertracing/jaeger/cmd/remote-storage/app" @@ -26,7 +25,7 @@ type RemoteMemoryStorage struct { } func StartNewRemoteMemoryStorage(t *testing.T) *RemoteMemoryStorage { - logger := zaptest.NewLogger(t, zaptest.Level(zap.DebugLevel)) + logger := zaptest.NewLogger(t) opts := &app.Options{ GRPCHostPort: ports.PortToHostPort(ports.RemoteStorageGRPC), Tenancy: tenancy.Options{