Skip to content

Commit

Permalink
Minor clean-up after #3640 (#3653)
Browse files Browse the repository at this point in the history
  • Loading branch information
yurishkuro authored May 4, 2022
1 parent 99ec00f commit 754880c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 3 additions & 1 deletion plugin/storage/grpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---------------------
Expand Down
11 changes: 7 additions & 4 deletions plugin/storage/integration/grpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 754880c

Please sign in to comment.