Class BowireOtlpProtocol

Namespace
Kuestenlogik.Bowire.Protocol.Otlp
Assembly
Kuestenlogik.Bowire.Protocol.Otlp.dll

Bowire protocol plugin for the OpenTelemetry Protocol (OTLP) in passive listener mode — the workbench opens an OTLP receiver and SUTs export to it via OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:<port>. Every received export surfaces here channel-style so operators can inspect traces / metrics / logs alongside their invokes.

public sealed class BowireOtlpProtocol : IBowireProtocol
Inheritance
BowireOtlpProtocol
Implements
Inherited Members

Remarks

Phase 1 receives both application/json and the OTLP-default application/x-protobuf: JSON is forwarded verbatim, protobuf is captured as base64 with the wire-level metadata. Phase 2 swaps the base64 branch for an inline decode via vendored opentelemetry-proto descriptors.

The plugin doesn't make outbound calls — serverUrl is read only as the discovery anchor for the workbench's per-URL grouping. InvokeAsync(string, string, string, List<string>, bool, Dictionary<string, string>?, CancellationToken) returns the most recent envelope of the requested kind; InvokeStreamAsync(string, string, string, List<string>, bool, Dictionary<string, string>?, CancellationToken) subscribes to the envelope-store publish/subscribe channel and yields each export as it arrives.

Constructors

BowireOtlpProtocol()

public BowireOtlpProtocol()

Properties

Description

One-line description shown next to the plugin's display name in Settings → Plugins. Optional; defaults to empty so the row falls back to "DisplayName + version" without the description line. Keep it short (≤ 100 characters) — the row truncates anything wider than the manage panel.

public string Description { get; }

Property Value

string

IconSvg

SVG icon for the protocol tab.

public string IconSvg { get; }

Property Value

string

Id

Short identifier (e.g., "grpc", "signalr").

public string Id { get; }

Property Value

string

Name

Protocol name shown in UI tabs.

public string Name { get; }

Property Value

string

Methods

DiscoverAsync(string, bool, CancellationToken)

Discovery surfaces a single virtual service OtlpReceiver with three methods — one per OTLP signal. Each method is marked ServerStreaming so the workbench's channel UX picks the right shape (receive-only stream of envelopes).

public Task<List<BowireServiceInfo>> DiscoverAsync(string serverUrl, bool showInternalServices, CancellationToken ct = default)

Parameters

serverUrl string
showInternalServices bool
ct CancellationToken

Returns

Task<List<BowireServiceInfo>>

Initialize(IServiceProvider?)

Called after registration to inject the app's service provider (embedded mode).

public void Initialize(IServiceProvider? serviceProvider)

Parameters

serviceProvider IServiceProvider

InvokeAsync(string, string, string, List<string>, bool, Dictionary<string, string>?, CancellationToken)

Returns the most recently received envelope of the kind named by method. Treat this as "snapshot the current state" — for live streaming use InvokeStreamAsync(string, string, string, List<string>, bool, Dictionary<string, string>?, CancellationToken).

public Task<InvokeResult> InvokeAsync(string serverUrl, string service, string method, List<string> jsonMessages, bool showInternalServices, Dictionary<string, string>? metadata = null, CancellationToken ct = default)

Parameters

serverUrl string
service string
method string
jsonMessages List<string>
showInternalServices bool
metadata Dictionary<string, string>
ct CancellationToken

Returns

Task<InvokeResult>

InvokeStreamAsync(string, string, string, List<string>, bool, Dictionary<string, string>?, CancellationToken)

Subscribes to the envelope-store publish/subscribe channel and yields each newly received envelope (filtered by signal kind) as a JSON string. The stream stays open until ct is cancelled.

public IAsyncEnumerable<string> InvokeStreamAsync(string serverUrl, string service, string method, List<string> jsonMessages, bool showInternalServices, Dictionary<string, string>? metadata = null, CancellationToken ct = default)

Parameters

serverUrl string
service string
method string
jsonMessages List<string>
showInternalServices bool
metadata Dictionary<string, string>
ct CancellationToken

Returns

IAsyncEnumerable<string>

OpenChannelAsync(string, string, string, bool, Dictionary<string, string>?, CancellationToken)

OTLP is receive-only — there's no bidirectional channel to open. The workbench's stream surface (InvokeStreamAsync(string, string, string, List<string>, bool, Dictionary<string, string>?, CancellationToken)) covers the live-tail case.

public Task<IBowireChannel?> OpenChannelAsync(string serverUrl, string service, string method, bool showInternalServices, Dictionary<string, string>? metadata = null, CancellationToken ct = default)

Parameters

serverUrl string
service string
method string
showInternalServices bool
metadata Dictionary<string, string>
ct CancellationToken

Returns

Task<IBowireChannel>