Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor clean-up after #3640 #3653

Merged
merged 1 commit into from
May 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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