diff --git a/plugin/storage/grpc/README.md b/plugin/storage/grpc/README.md index 73c6c05c43a..d70e0944c1d 100644 --- a/plugin/storage/grpc/README.md +++ b/plugin/storage/grpc/README.md @@ -112,7 +112,9 @@ grpc.Serve(&shared.PluginServices{ }) ``` -To support writing span via client stream (which can enlarge the throughput), you must fill `StreamingSpanWriter` with the same plugin with `Store` field. Note that use streaming spanWriter may make the `save_by_svr` metric inaccurate, in which case users will need to pay attention to the metrics provided by 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. + +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. Running with a plugin --------------------- diff --git a/plugin/storage/integration/grpc_test.go b/plugin/storage/integration/grpc_test.go index 26e3dbb9e36..8fe51986f17 100644 --- a/plugin/storage/integration/grpc_test.go +++ b/plugin/storage/integration/grpc_test.go @@ -12,6 +12,7 @@ // 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. + //go:build grpc_storage_integration // +build grpc_storage_integration @@ -157,11 +158,11 @@ func getPluginFlags(t *testing.T) []string { func TestGRPCStorage(t *testing.T) { flags := getPluginFlags(t) - configPath := os.Getenv("PLUGIN_CONFIG_PATH") - if configPath == "" { + 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) } - flags = append(flags, "--grpc-storage-plugin.configuration-file", configPath) s := &GRPCStorageIntegrationTestSuite{ flags: flags, @@ -174,7 +175,9 @@ func TestGRPCStreamingWriter(t *testing.T) { flags := getPluginFlags(t) wd, err := os.Getwd() require.NoError(t, err) - flags = append(flags, "--grpc-storage-plugin.configuration-file", path.Join(wd, streamingPluginConfigPath)) + flags = append(flags, + "--grpc-storage-plugin.configuration-file", + path.Join(wd, streamingPluginConfigPath)) s := &GRPCStorageIntegrationTestSuite{ flags: flags,