Skip to content

Integration Grpc Extension

aryehcitron@gmail.com edited this page Nov 7, 2026 · 27 revisions

Integration: gRPC Extension

Track gRPC client calls in your test diagrams using the Kronikol.Extensions.Grpc NuGet package. This extension intercepts all gRPC call types (unary, server-streaming, client-streaming, duplex-streaming) via the standard Grpc.Core.Interceptors.Interceptor API.

Using a shared library or abstraction layer? If your code doesn't use gRPC channels directly — e.g. it goes through a shared client library or custom abstraction — this extension won't be able to intercept the underlying calls. See Tracking Custom Dependencies for alternative approaches including RequestResponseLogger.LogPair() and TrackingProxy<T>.

Installation

dotnet add package Kronikol.Extensions.Grpc

Client versions

The package asks for Grpc.Net.Client 2.45.0 or later and Google.Protobuf 3.19.4 or later, so a suite can pin whichever releases its application ships with. The package's own suite runs on the newest of each, against the newest Grpc.AspNetCore server, and in CI on the floors as well, against the 2.45.0 server. A project that takes these only through this package resolves the floors; reference them yourself for newer ones.

Quick Start

What your production code looks like

Your production code creates gRPC clients normally — no tracking code here:

// Program.cs / Startup.cs — register gRPC clients via DI
services.AddSingleton(sp =>
{
    var channel = GrpcChannel.ForAddress("https://greeter-service:5001");
    return new Greeter.GreeterClient(channel);
});

// Or using the gRPC client factory:
services.AddGrpcClient<Greeter.GreeterClient>(o =>
{
    o.Address = new Uri("https://greeter-service:5001");
});
// GreetingService.cs — uses the client via DI (no tracking awareness)
public class GreetingService
{
    private readonly Greeter.GreeterClient _greeterClient;

    public GreetingService(Greeter.GreeterClient greeterClient)
    {
        _greeterClient = greeterClient;
    }

    public async Task<string> GetGreeting(string name)
    {
        var reply = await _greeterClient.SayHelloAsync(new HelloRequest { Name = name });
        return reply.Message;
    }
}

Adding tracking in your tests

In your test setup, replace the production gRPC client registration with a tracked version. The simplest approach uses the AddTrackedGrpcClient<TClient>() DI extension, which handles channel creation, the tracking interceptor, and auto-resolves IHttpContextAccessor from DI so test identity propagation works out of the box:

// TestSetupHooks.cs or WebApplicationFactory setup
builder.ConfigureTestServices(services =>
{
    // Replace the production client with a tracked one
    services.RemoveAll<Greeter.GreeterClient>();
    services.AddTrackedGrpcClient<Greeter.GreeterClient>(
        handler, // HttpMessageHandler for the downstream service
        new Uri("https://localhost:5001"),
        opts =>
        {
            opts.ServiceName = "GreeterService";
            opts.CallerName = "MyApi";
            opts.Verbosity = GrpcTrackingVerbosity.Detailed;
            opts.CurrentTestInfoFetcher = () => (TestContext.CurrentTestName, TestContext.CurrentTestId);
            // IHttpContextAccessor is auto-resolved from DI — no manual wiring needed
        });
});

Or use the channel extension directly if you prefer more control:

var interceptor = new GrpcTrackingInterceptor(new GrpcTrackingOptions
{
    ServiceName = "GreeterService",
    CallerName = "MyApi",
    CurrentTestInfoFetcher = () => (TestContext.CurrentTestName, TestContext.CurrentTestId)
});

var channel = GrpcChannel.ForAddress("https://localhost:5001");
var invoker = channel.Intercept(interceptor);
var client = new Greeter.GreeterClient(invoker);

Key point: Your production code (controllers, services, etc.) stays unchanged. The only difference is how the gRPC client is constructed — tests wrap the channel with the tracking interceptor via DI replacement.

SUT → downstream gRPC: When your SUT calls a downstream gRPC service during request processing, the client runs on the SUT's worker thread where CurrentTestInfoFetcher cannot access the test framework context. v2.26.0+: AddTrackedGrpcClient<TClient>() and CreateTestTrackingGrpcClient auto-resolve IHttpContextAccessor from DI, so test identity flows through HTTP context headers automatically, and (4.13.0+) carries on to the downstream service in the call's metadata, so a downstream service that registers AddTestTrackingContextPropagation() attributes its own calls too (A host called over gRPC). See Dual-Resolution Test Identity and DI Extension below.

Tracking Incoming gRPC Calls (Test → SUT)

If your SUT exposes a gRPC service (i.e. the test calls the SUT via gRPC), you can get rich gRPC-aware diagrams for the incoming leg too — with protobuf message deserialization, operation classification, and grpc:// URIs. Without this, incoming gRPC calls would appear as raw HTTP/2 POST requests with binary bodies.

One-liner: CreateTestTrackingGrpcClient (recommended)

The simplest approach mirrors the HTTP convenience API. This single call handles everything — ResponseVersionHandler (HTTP/2 fix), channel creation, tracking interceptor, and client construction:

using Kronikol.Extensions.Grpc;

var client = factory.CreateTestTrackingGrpcClient<Program, Greeter.GreeterClient>(
    new GrpcTrackingOptions
    {
        ServiceName = "My API",
        CallerName = "Caller",
        CurrentTestInfoFetcher = () => (testName, testId)
    });

If you need to dispose the underlying GrpcChannel cleanly (e.g. in [AfterScenario]), use the WithChannel variant:

var (client, channel) = factory.CreateTestTrackingGrpcClientWithChannel<Program, Greeter.GreeterClient>(
    new GrpcTrackingOptions
    {
        ServiceName = "My API",
        CallerName = "Caller",
        CurrentTestInfoFetcher = () => (testName, testId)
    });

// Later, in cleanup:
channel.Dispose();

Both reach the factory's server under the factory's lock (5.6.1+), as CreateTestTrackingClient() makes its client, so tests running in parallel can share one factory: before, two tests reaching a factory's server first at the same moment each started the application (Parallel tests sharing one factory).

Manual: GrpcTrackingChannel.Create()

For more control (e.g. when you need a custom handler chain), use GrpcTrackingChannel.Create() directly. When testing against TestServer, wrap the handler with GrpcResponseVersionHandler to fix the HTTP/1.1 → HTTP/2 version mismatch:

using Kronikol.Extensions.Grpc;

// In your test setup (e.g. constructor, [BeforeScenario], etc.)
var invoker = GrpcTrackingChannel.Create(
    new GrpcResponseVersionHandler(factory.Server.CreateHandler()),
    factory.Server.BaseAddress,
    new GrpcTrackingOptions
    {
        ServiceName = "My API",
        CallerName = "Caller",
        Verbosity = GrpcTrackingVerbosity.Detailed,
        CurrentTestInfoFetcher = () =>
        {
            var test = TestContext.Current.Test;
            return test is not null
                ? (test.TestDisplayName, test.UniqueID)
                : ("Unknown", "unknown");
        }
    });

// Create your typed gRPC client from the tracked invoker
var client = new Greeter.GreeterClient(invoker);

If you need to dispose the underlying GrpcChannel cleanly (e.g. in [AfterScenario]), use CreateWithChannel:

var (invoker, channel) = GrpcTrackingChannel.CreateWithChannel(
    new GrpcResponseVersionHandler(factory.Server.CreateHandler()),
    factory.Server.BaseAddress,
    new GrpcTrackingOptions
    {
        ServiceName = "My API",
        CallerName = "Caller",
        CurrentTestInfoFetcher = CurrentTestInfo.Fetcher
    });

var client = new Greeter.GreeterClient(invoker);

// Later, in cleanup:
channel.Dispose();

There's also an extension method on HttpMessageHandler for terser syntax:

var invoker = factory.Server.CreateHandler()
    .AsGrpcTrackingCallInvoker(factory.Server.BaseAddress, grpcOptions);

What you get vs raw HTTP tracking

Aspect Without gRPC extension With GrpcTrackingChannel.Create()
Label POST SayHello or StreamOrders (server-stream)
URI http://localhost/greet.Greeter/SayHello grpc:///greet.Greeter/SayHello
Request body Binary protobuf (unreadable) JSON-formatted protobuf fields
Response body Binary protobuf JSON-formatted protobuf fields
Operation type None UnaryCall, ServerStreamingCall, etc.
Status mapping HTTP/2 status gRPC StatusCode → HTTP mapping
Dependency colour HTTP (blue) gRPC (uses DependencyCategory: "gRPC")

Important: Do not also wrap the underlying HTTP handler with TestTrackingMessageHandler or CreateTestTrackingClient() for gRPC calls — this would produce duplicate diagram entries (one from the HTTP layer, one from the gRPC interceptor). Use GrpcTrackingChannel.Create() instead of, not in addition to, HTTP tracking for the gRPC test client.

Tip: If your test project makes both HTTP and gRPC calls to the SUT, use CreateTestTrackingClient() for the HTTP client and GrpcTrackingChannel.Create() for the gRPC client. They log to the same RequestResponseLogger and will appear together in the same diagram.

A host called over gRPC

4.13.0+: every call the interceptor makes carries the test's identity in its metadata, in the four headers TestTrackingMessageHandler sends: test-tracking-current-test-name, test-tracking-current-test-id, test-tracking-trace-id and test-tracking-caller-name. A host that registers AddTestTrackingContextPropagation() begins a TestIdentityScope from them for each call it serves, as it does for an HTTP request, so the database, HTTP and messaging calls it makes while serving a gRPC call land in the scenario that made it. That holds for a service the test calls over gRPC (CreateTestTrackingGrpcClient, GrpcTrackingChannel) and for one a host calls (AddTrackedGrpcClient).

  • Every hop. A host that received the identity, over HTTP or gRPC, passes it on with its own gRPC calls, so a chain of three or more hosts stays in one scenario.
  • Only a scenario's identity. When nothing names a scenario (the background, or a flow detached from the test), no identity header is sent, and the called host resolves its own.
  • Whatever the phase. A call not tracked in the current phase (TrackDuringSetup = false or TrackDuringAction = false) still carries the identity.
  • The caller's own headers win. A header the call's metadata already holds is left as it is, so an interceptor that adds them itself keeps working.
  • One trace id across the hop. test-tracking-trace-id is the one the caller put in the call's metadata, else the Kronikol trace id of the request the host is serving, which the interceptor reads through its IHttpContextAccessor, else a new one, and the call is logged with it (a caller's own since 4.16.1: before, the call sent it but was logged with another). In the called host, the HTTP handler and the gRPC interceptor reuse it when they hold the host's accessor, as MessageTracker with UseHttpContextCorrelation and ProxyTap do, so kronikol query flow nests their calls under the gRPC call even when the two sides name the service differently. A database or cloud tracker makes a trace id of its own, so its calls nest under the gRPC call only when the names match: the gRPC call's service name is that tracker's CallerName.
  • Encoding. A name or id that is not plain ASCII is sent in the UTF-8'' form (HTTP Tracking Setup › Header values).
  • Diagrams. The logged request headers are the caller's own, so no note gains a line.

Set PropagateTestIdentity = false on GrpcTrackingOptions to send none of the four. Until 4.13.0 the interceptor sent only a traceparent, so a host called over gRPC recorded its own calls under no scenario (#134).

How It Works

GrpcTrackingInterceptor extends Grpc.Core.Interceptors.Interceptor, overriding all five call types:

Call Type Override Tracking
Async Unary AsyncUnaryCall Full request + response
Blocking Unary BlockingUnaryCall Full request + response
Server Streaming AsyncServerStreamingCall Request + outcome when the stream ends
Client Streaming AsyncClientStreamingCall Request + response when it arrives
Duplex Streaming AsyncDuplexStreamingCall Request + outcome when the stream ends

A streaming call's response is recorded when the call ends (4.13.2+): OK when its response stream is read to its end (or, for a client stream, when its response arrives, with that response); the gRPC status, mapped as for a unary call, with "{code}: {message}", when it fails; and Cancelled when the call is disposed before its stream ends and before its status is known. Its span lasts until then. The messages of a stream are not recorded, to keep diagrams clean, and a call neither read to its end nor disposed has no response recorded. Until 4.13.2 every streaming call was recorded as OK, with no content, as soon as it started, so a stream that failed read as a success.

A call that fails with something other than an RpcException is recorded too, with "{code}: {message}": an OperationCanceledException as Cancelled (408), and anything else as Unknown (500). A channel with ThrowOperationCanceledOnCancellation throws an OperationCanceledException where it would throw an RpcException with Cancelled. A stream that failed was recorded this way from 4.13.2; since 4.16.1 a unary call is too, and so is a call of any kind whose continuation throws as it starts, as one on a disposed channel does. Before, such a call left its request without a response. Since 4.16.1, too, a streaming call that its caller disposes leaves the caller's Activity.Current as it was (before, it became the span that was current when the call started), and its outcome is recorded even when reading its status or its own dispose throws.

Supported Operations

Method Type Enum Value
Unary GrpcOperation.UnaryCall
Server Streaming GrpcOperation.ServerStreamingCall
Client Streaming GrpcOperation.ClientStreamingCall
Duplex Streaming GrpcOperation.DuplexStreamingCall
Other GrpcOperation.Other

Message Serialization

Request and response messages are serialized for diagram content:

  • Protobuf IMessage: JSON from Google.Protobuf.JsonFormatter.ToDiagnosticString() (4.16.1), the text JsonFormatter.Default.Format() writes except that a google.protobuf.Any is written as its "@type" and its bytes, base64, as "@value". JsonFormatter.Default, whose type registry is empty, throws on an Any, so until 4.16.1 a call carrying one failed with InvalidOperationException ("Type registry has no descriptor for type name ...")
  • Other types: Falls back to .ToString()
  • A message that cannot be written at all: a short note in its place, ({type} could not be written: {error}), and the call goes on (4.16.1)
  • Summarised verbosity: Content omitted entirely

gRPC Status Code Mapping

gRPC status codes are mapped to HTTP status codes for consistent diagram logging:

gRPC Status HTTP Status
OK 200 OK
NotFound 404 Not Found
PermissionDenied 403 Forbidden
Unauthenticated 401 Unauthorized
InvalidArgument 400 Bad Request
DeadlineExceeded 408 Request Timeout
AlreadyExists 409 Conflict
ResourceExhausted 429 Too Many Requests
Unavailable 503 Service Unavailable
Unimplemented 501 Not Implemented
Cancelled 408 Request Timeout
Other 500 Internal Server Error

Verbosity Levels

GrpcTrackingVerbosity.Summarised

Minimal output:

  • Label: Method name only (e.g. SayHello)
  • URI: grpc:///ServiceName/
  • Content: Omitted
  • Headers: Omitted

GrpcTrackingVerbosity.Detailed

Balanced output:

  • Label: Method name with streaming annotation (e.g. SayHello, StreamMessages (server-stream))
  • URI: grpc:///ServiceName/MethodName
  • Content: Serialized protobuf messages
  • Headers: Omitted

GrpcTrackingVerbosity.Raw

Full output:

  • Label: /package.Service/Method [UnaryCall]
  • URI: grpc:///package.Service/Method
  • Content: Serialized protobuf messages
  • Headers: Included (non-binary metadata entries)

Configuration Options

new GrpcTrackingOptions
{
    // Display name in diagrams (default: "GrpcService")
    ServiceName = "GreeterService",

    // Calling service name in diagrams (default: "Caller")
    CallerName = "MyApi",

    // Verbosity level (default: Detailed)
    Verbosity = GrpcTrackingVerbosity.Detailed,

    // Required: provides test context
    CurrentTestInfoFetcher = () => (testName, testId),

    // Use proto service name instead of ServiceName (default: false)
    UseProtoServiceNameInDiagram = false,

    // Resolves test identity from HTTP context headers when running inside
    // the SUT's request pipeline. Auto-resolved from DI by AddTrackedGrpcClient
    // and CreateTestTrackingGrpcClient (v2.26.0+). Manual override still supported.
    HttpContextAccessor = sp.GetRequiredService<IHttpContextAccessor>()
}

GrpcTrackingOptions

Property Type Default Description
ServiceName string "GrpcService" Display name in diagrams for the gRPC service
CallerName string "Caller" Calling service name in diagrams
Verbosity GrpcTrackingVerbosity Detailed Verbosity level (Raw, Detailed, Summarised)
CurrentTestInfoFetcher Func<(string Name, string Id)>? null Required: provides test context
CurrentStepTypeFetcher Func<string?>? null Has no effect: nothing in the gRPC package reads it (only the HTTP handler's option of the same name does). Its removal is a v6 question
HttpContextAccessor IHttpContextAccessor? null Resolves test identity from HTTP context headers when running inside the SUT's request pipeline. Auto-resolved from DI by AddTrackedGrpcClient and CreateTestTrackingGrpcClient (v2.26.0+).
UseProtoServiceNameInDiagram bool false Use proto service name instead of ServiceName
SetupVerbosity GrpcTrackingVerbosity? null Verbosity override for the Setup phase. See Phase-Aware Tracking
ActionVerbosity GrpcTrackingVerbosity? null Verbosity override for the Action phase. See Phase-Aware Tracking
TrackDuringSetup bool true When false, tracking is suppressed during Setup. See Phase-Aware Tracking
TrackDuringAction bool true When false, tracking is suppressed during Action. See Phase-Aware Tracking
PropagateTestIdentity bool true Puts the test identity into each call's metadata, on every hop, so a host that calls AddTestTrackingContextPropagation() attributes its own calls to the scenario (4.13.0+). See [[A host called over gRPC

UseProtoServiceNameInDiagram

When true, the proto service name from the method definition (e.g. greet.Greeter) is used as the service name in diagrams instead of the configured ServiceName. Useful when tracking multiple gRPC services through a single interceptor.

Dual-Resolution Test Identity (HttpContextAccessor)

When tracking gRPC calls made by the SUT to a downstream gRPC service (SUT-to-downstream direction), the gRPC client runs inside the SUT's request pipeline on a worker thread — not on the test thread. The CurrentTestInfoFetcher delegate typically fails here because test framework execution context (e.g. ScenarioExecutionContext.CurrentScenario) is not available on the SUT's worker thread.

v2.26.0+: AddTrackedGrpcClient<TClient>() and CreateTestTrackingGrpcClient auto-resolve IHttpContextAccessor from DI when it is not explicitly set. This means test identity flows through HTTP context headers automatically — no manual wiring required:

// v2.26.0+ — IHttpContextAccessor is auto-resolved from DI
services.RemoveAll<NotificationGrpc.NotificationGrpcClient>();
services.AddTrackedGrpcClient<NotificationGrpc.NotificationGrpcClient>(
    new GrpcResponseVersionHandler(testServerHandler),
    new Uri("http://localhost"),
    opts =>
    {
        opts.ServiceName = "Notification Service (gRPC)";
        opts.CallerName = "MyApi";
        opts.CurrentTestInfoFetcher = CurrentTestInfo.Fetcher;
        // HttpContextAccessor auto-resolved — no need to set it manually
    });

The interceptor first checks the identity headers (test-tracking-current-test-name / test-tracking-current-test-id) of the request being served, written by TestTrackingMessageHandler or an upstream GrpcTrackingInterceptor and read through the accessor; then CurrentTestInfoFetcher; then TestIdentityScope.Current, which in a host that registers AddTestTrackingContextPropagation() is the scope its middleware begins for each request carrying the headers; then TestIdentityScope.GlobalFallback. A flow detached from the test skips the fetcher and the global fallback (HTTP Tracking Setup › How It Works Internally).

Manual wiring (v2.25.2 — still supported but no longer necessary)

If you prefer explicit control, you can still set HttpContextAccessor manually:

services.AddSingleton(sp =>
{
    var options = new GrpcTrackingOptions
    {
        ServiceName = "Notification Service (gRPC)",
        CallerName = "MyApi",
        Verbosity = GrpcTrackingVerbosity.Detailed,
        CurrentTestInfoFetcher = CurrentTestInfo.Fetcher,
        HttpContextAccessor = sp.GetRequiredService<IHttpContextAccessor>()
    };

    var invoker = new GrpcResponseVersionHandler(testServerHandler)
        .AsGrpcTrackingCallInvoker(new Uri("http://localhost"), options);

    return new NotificationGrpc.NotificationGrpcClient(invoker);
});

Important: Without HttpContextAccessor (either auto-resolved or manual), a gRPC call made inside the SUT's request pipeline cannot read the identity headers of the request being served, and CurrentTestInfoFetcher cannot resolve test identity on the SUT's worker thread. In a host that registers AddTestTrackingContextPropagation() the call still lands in the scenario, through the scope the middleware began for that request (attribution Scope), and passes the identity on (4.13.0+). What it loses is the request's Kronikol trace id, which the interceptor reads only through the accessor: the call gets a trace id of its own, so kronikol query flow nests it under the request the host is serving only when the names match (the interceptor's CallerName is the service name that request was logged with). In a host without the middleware, such a call resolves no identity unless a TestIdentityScope or the global fallback names a test, and is then passed on unlogged, unless RequestResponseLogger.CaptureBackground is on, when it is logged as background (Unknown).

DI Extension: AddTrackedGrpcClient<TClient>()

v2.26.0+ — The AddTrackedGrpcClient<TClient>() extension method on IServiceCollection provides a one-liner for registering tracked gRPC clients via DI, matching the pattern used by other Kronikol extensions (BigQuery, Bigtable, MongoDB, etc.). It:

  1. Creates the GrpcChannel with the provided handler
  2. Installs a GrpcTrackingInterceptor
  3. Constructs the typed gRPC client
  4. Auto-resolves IHttpContextAccessor from DI when not explicitly set
using Kronikol.Extensions.Grpc;

// In ConfigureTestServices:
services.RemoveAll<Greeter.GreeterClient>();
services.AddTrackedGrpcClient<Greeter.GreeterClient>(
    new GrpcResponseVersionHandler(testServerHandler),
    new Uri("http://localhost"),
    opts =>
    {
        opts.ServiceName = "Greeter Service";
        opts.CallerName = "My API";
        opts.Verbosity = GrpcTrackingVerbosity.Detailed;
        opts.CurrentTestInfoFetcher = CurrentTestInfo.Fetcher;
    });

The configure callback is optional — defaults produce a GrpcTrackingVerbosity.Detailed interceptor with ServiceName = "GrpcService":

services.AddTrackedGrpcClient<Greeter.GreeterClient>(handler, baseAddress);

The client is registered as a singleton, consistent with typical gRPC client lifetimes. If you need to replace an existing production registration, call services.RemoveAll<TClient>() first.

When to use this vs CreateTestTrackingGrpcClient: Use AddTrackedGrpcClient<TClient>() when the SUT calls a downstream gRPC service (SUT → downstream). Use CreateTestTrackingGrpcClient when the test calls the SUT via gRPC (test → SUT).

ITrackingComponent

GrpcTrackingInterceptor implements ITrackingComponent and auto-registers with TrackingComponentRegistry:

  • ComponentName: "GrpcTrackingInterceptor ({ServiceName})"
  • WasInvoked: true after first call
  • InvocationCount: Total calls processed (all call types)
  • HasHttpContextAccessor: true when the interceptor holds an IHttpContextAccessor, from its constructor or its options (4.13.0+), which the diagnostic page's HttpContextAccessor column counts

URI Scheme

Verbosity Format Example
Summarised grpc:///ServiceName/ grpc:///greet.Greeter/
Detailed grpc:///ServiceName/MethodName grpc:///greet.Greeter/SayHello
Raw grpc:///FullMethodPath grpc:////greet.Greeter/SayHello

GrpcResponseVersionHandler

When testing gRPC services in-process via TestServer (e.g. from WebApplicationFactory), TestServer returns HTTP/1.1 responses, but gRPC requires HTTP/2. Without fixing this, the gRPC client throws RpcException with status Internal.

GrpcResponseVersionHandler is a DelegatingHandler that copies the request version onto the response, resolving the mismatch:

// Wrap TestServer's handler for gRPC compatibility
var handler = new GrpcResponseVersionHandler(factory.Server.CreateHandler());

Note: You do not need to use GrpcResponseVersionHandler directly if you use CreateTestTrackingGrpcClient — it is applied automatically.

Activity Diagrams & Flamecharts

gRPC calls tracked by GrpcTrackingInterceptor automatically appear in Activity Diagrams and Flamecharts. The interceptor:

  1. Creates a System.Diagnostics.Activity span (via ActivitySource("Kronikol.Grpc")) around each gRPC call. For async unary calls, the span covers the full call duration from request to response, and the caller's own Activity.Current is given back when the call starts (4.12.1+; before, the next call the test made became the span's child)
  2. Populates ActivityTraceId, ActivitySpanId, and Timestamp on all logged request/response entries
  3. Lazily starts the InternalFlowActivityListener to capture spans into the span store
  4. Injects a traceparent metadata header into outgoing gRPC calls so server-side ASP.NET Core spans share the same TraceId, which connects the client-side gRPC span to the server-side processing span in Activity Diagrams. Its flags say sampled (01) when the span is recorded, so a host sampling with OpenTelemetry's default ParentBased sampler keeps its server span; under Kronikol's own listener alone they say 00. A traceparent the caller set is kept. (4.12.1+: the interceptor sends metadata of its own, copying the caller's entries, so a Metadata reused for several calls, or Metadata.Empty, is left as it was. Before, a reused one gained a traceparent per call, which the called host received joined into one value it could not parse, and Metadata.Empty threw.)

The "Kronikol.Grpc" and "Grpc.Net.Client" activity sources are included in WellKnownAutoInstrumentationSources, so gRPC spans are captured automatically under the default AutoInstrumentation granularity — no extra configuration required.

No additional configuration is required — if your report includes Activity Diagrams or Flamecharts, gRPC calls will appear alongside HTTP calls automatically.

A call that fails

A call that fails with an RpcException is answered with its status mapped to HTTP (Unavailable is 503) and the note {code}: {message}, with the reason now in error too (5.34.3, #232). A call that fails with anything else but a cancellation, a shut-down channel among them, was answered 500, which no service sent; it is now ! and the exception's type, with its message chain in error. History's older rules still read the call as the release before recorded it, so a suite that upgrades reads no change there (Cross-Run History).

See Also

Home · 🔍 Search this wiki Full-text search across every page. The “Pages” list above matches page and heading names, not page content.


Demo


Getting Started

Common Tasks

Integration Guides

Uninstrumentable / polyglot backends

Extensions

Configuration

Features

Reference

Clone this wiki locally