gRPC Protocol Guide

Use this guide when gRPC services are part of the workflow and you need unary or streaming calls to participate in the same LoadStrike tracking and reporting model.

What this page helps you do

What this page helps you do

Use this guide when gRPC services are part of the workflow and you need unary or streaming calls to participate in the same LoadStrike tracking and reporting model.

Who this is for

Teams deciding how a protocol or browser runtime should fit inside one transaction-aware scenario.

Prerequisites

  • A transport or browser flow that already matters to the workload

By the end

A clearer protocol-specific path that still fits the same scenario and reporting model.

Use this page when

Use this page when gRPC Protocol Guide belongs inside the transaction story and you need the supported path into the same scenario model.

Visual guide

Transaction diagram showing source action, handoff, downstream processing, and completion.
The settings on this page only make sense when the workflow is treated as one transaction from source action to downstream completion.

Guide

What This Guide Covers

Use this guide when gRPC is the source, destination, or one important hop in the transaction. C#, Java, Python, TypeScript, JavaScript, and Go all support delegate-backed Produce and Consume endpoints with service name, method name, method type, metadata, and deadline settings. Native gRPC execution is not available.

Tracking And Outcomes

Keep the tracking selector stable across the source and destination path. The delegate performs the real unary or streaming work and returns the produced or consumed outcome that LoadStrike uses for correlation and reporting.

Use Your Existing Client

Use the delegate to call your generated gRPC client and apply the project's authentication, service discovery, serialization, and status mapping. Remove a previous NativeClient block and provide the matching Produce or Consume delegate instead. Without it, initialization reports `Native gRPC execution is not available in this SDK version. Provide the endpoint Produce/Consume delegate instead.`

Plan Gate

gRPC endpoint support is available on Pro and above. Runs still validate any extra features used by the scenario, such as portal reporting, sinks, thresholds, or distributed cluster settings.

Protocol setup samples

Use these samples for delegate-backed gRPC Produce or Consume endpoints. Every SDK requires the matching mode delegate. Without one, initialization fails with `Native gRPC execution is not available in this SDK version. Provide the endpoint Produce/Consume delegate instead.`

If you run these examples locally, add a valid runner key before execution starts. Set it with WithRunnerKey("...") or the config key LoadStrike:RunnerKey.

gRPC Protocol Setup

using LoadStrike;
using LoadStrike.CrossPlatform.Grpc;
using LoadStrike.CrossPlatform.Delegates;
using LoadStrike.CrossPlatform;

// Native gRPC execution is not available in this SDK version.
// Provide the endpoint Produce/Consume delegate instead.
var endpoint = new GrpcEndpointDefinition
{
    Name = "orders-grpc",
    Mode = TrafficEndpointMode.Produce,
    TrackingField = TrackingFieldSelector.Parse("json:$.trackingId"),
    Target = "https://grpc.example.com",
    ServiceName = "orders.OrderService",
    MethodName = "CreateOrder",
    MethodType = "Unary",
    ProduceAsync = (request, _) => Task.FromResult(new ProducedMessageResult { IsSuccess = true })
};

_ = endpoint;

Goal

Service and method

Name the gRPC service and method so the endpoint represents the exact protocol call being measured.

Method type

Choose unary, server streaming, client streaming, or bidirectional streaming based on the workflow shape.

Tracking selector

Use stable metadata or message fields so gRPC work can be correlated with the rest of the transaction.

Required delegate

Provide Produce or Consume for Go, or ProduceAsync / ConsumeAsync in async-named SDKs, for the selected mode. The delegate calls your generated gRPC client and returns the LoadStrike payload result. Without it, every SDK uses the shared fail-closed diagnostic shown above.