Skip to content

API Reference

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

Core Library (Kronikol)

Class / Record Description
ReportConfigurationOptions Configuration for report file names, titles, PlantUML server, excluded headers, setup separation, focus styling, PlantUML theme, image format, and custom stylesheets.
DiagramsFetcherOptions Configuration for diagram content formatting processors, header exclusions, setup separation, focus styling, PlantUML theme, and image format.
DefaultDiagramsFetcher Static class; GetDiagramsFetcher(options?) returns a Func<DiagramAsCode[]> that fetches all generated diagrams.
DefaultDiagramsFetcher.DiagramAsCode Record containing TestRuntimeId, ImgSrc (rendered PNG URL), and CodeBehind (raw PlantUML).
DefaultTrackingDiagramOverride Static class for manual diagram control: StartOverride, EndOverride, InsertPlantUml, InsertTestDelimiter, StartAction. Each accepts an optional DiagramMarkerKind classifying the fragment; the default, Custom, is exported as a scenario annotation.
DiagramFocus Static class for declarative field highlighting. Request<T>(...) and Response<T>(...) set focus fields for the next HTTP call. Prefer the fluent WithDiagramFocus() API when the focus and HTTP call are in the same method. See [[Content Formatting › DiagramFocus (Field Highlighting)
HttpClientDiagramFocusExtensions Extension method WithDiagramFocus() on HttpClient. Returns a FocusedHttpClient for fluent focus configuration.
FocusedHttpClient Fluent builder returned by WithDiagramFocus(). Chain .OnRequest<T>(...) / .OnResponse<T>(...) then a terminal HTTP method (PostAsJsonAsync, GetAsync, etc.) or .ApplyFocus() to get back the underlying HttpClient for use with custom extension methods.
FocusEmphasis [Flags] enum: None, Bold, Colored. Controls styling of focused fields in diagram notes.
FocusDeEmphasis [Flags] enum: None, LightGray, SmallerText, Hidden. Controls styling of non-focused fields in diagram notes.
PlantUmlImageFormat Enum: Png, Svg, Base64Png, Base64Svg. Controls the image format used for rendered diagram URLs. Base64Png/Base64Svg embed images inline as data URIs (requires LocalDiagramRenderer).
DiagramFormat Enum: PlantUml. Controls the output format for sequence diagrams.
PlantUmlRendering Enum: Server, BrowserJs, Local, NodeJs. Controls how PlantUML diagrams are rendered. Server uses a remote PlantUML server. BrowserJs renders client-side via the official TeaVM JS engine with lazy IntersectionObserver rendering. Local renders in-process via IKVM (requires LocalDiagramRenderer). NodeJs renders locally via Node.js — downloads the PlantUML JS engine, shells out to node, and produces SVG (requires node on PATH).
JsonFocusFormatter Applies per-line PlantUML markup to pretty-printed JSON based on focus fields and emphasis/de-emphasis settings. Used internally by PlantUmlCreator.
TestTrackingMessageHandlerOptions Base configuration for the HTTP tracking handler (service names, port mappings, headers to forward).
TestTrackingMessageHandler DelegatingHandler that intercepts and logs HTTP requests/responses with tracking headers.
TestTrackingHttpClientFactory IHttpClientFactory implementation that creates HttpClient instances with the tracking handler.
RequestResponseLogger Static log collector; Log(entry) to add, LogPair(...) for convenience request/response pair logging, RequestAndResponseLogs to retrieve all entries.
RequestResponseLog Record capturing a single HTTP request or response with all metadata. Includes Timestamp, ActivitySpanId, ActivityTraceId for OTel correlation, DurationMs when the capturer measured the call itself, IsDiagramMarker (true for the control records — step bars, assertion notes, injected fragments, the Setup/Action boundary — that carry no interaction of their own, so every consumer that reports interactions skips them), and MarkerKind saying which kind of marker it is. See [[Tracking Custom Dependencies › RequestResponseLog Constructor Reference
DiagramMarkerKind Enum: Custom, Step, Assertion, Row, Phase. What a marker record stands for, set by whoever emits it. Row and Custom markers are exported as scenario annotations; the rest are already structured in steps.
ScenarioStep Record for one step or assertion sub-step. Beyond keyword, text, status and duration it carries IsAssertion (4.14.1, true for a tracked assertion; the data file writes "assertion": true for it), FailureMessage, SourceFile and SourceLine (why it failed and where the assertion lives), Parameters, TextSegments, DocString, Comments and BypassReason.
ScenarioStableId Static class; Compute(suite, featureName, scenarioDisplayName, outlineId?, exampleValues?) produces the deterministic cross-run scenario identifier written as stableId. For a Reqnroll outline row, whose name is filled from its values since 5.4.3, the report passes the outline's title as scenarioDisplayName, so the row keeps the id it had. Example values are folded into the hash so rows of one scenario outline do not collide, and since 3.1.0 so is the suite, so two projects naming a feature and a scenario the same way do not. A null or empty suite reproduces the pre-3.1.0 id exactly.
RunSuite Static class (3.1.0); Resolve(options) returns ReportConfigurationOptions.SuiteName when set and otherwise the probed test-assembly name, and Current is the probe on its own for callers with no options in hand. The probe reads the single *.deps.json beside AppContext.BaseDirectory — not GetEntryAssembly(), which is testhost under VSTest and would scope nothing, and not GetCallingAssembly(), which is not the test assembly on any of the adapter paths. Ambiguous or absent, it returns null rather than a guess: a wrong suite silently re-keys every scenario, an absent one only costs the cross-suite discrimination that was never there.
InteractionStatus Static class (3.1.0); Split(status) turns the captured OneOf<HttpStatusCode, string> into the (int? Code, string? Text) pair the data files write as statusCode and statusText, and Read(statusCode, statusText) reads that pair back out of a written report — accepting both the current two-field shape and the pre-3.1.0 single field, so a reader does not answer "no status" for every report written before the split.
MessageTracker Logs non-HTTP interactions (events, messages, commands) so they appear in diagrams. See Event & Message Tracking.
ServiceCollectionHelper.TrackMessagesForDiagrams() Extension method that registers MessageTracker in DI for non-HTTP interaction tracking.
WebApplicationFactoryExtensions.CreateTestTrackingClient() Creates an HttpClient with the tracking handler attached. Accepts the base TestTrackingMessageHandlerOptions so it works with any framework's options. Also supports params DelegatingHandler[] overload.
ServiceCollectionExtensions.TrackDependenciesForDiagrams() Registers tracking services in DI. Accepts the base TestTrackingMessageHandlerOptions.
ScenarioTitleResolver Static utility: FormatFeatureName(className) titleizes a test class name; FormatScenarioDisplayName(displayName) turns a fully-qualified test name into a sentence and appends its parameters in brackets (Ns.Class.GetHTTPResponse(p: "v") reads Get HTTP response [p: "v"]); ResolveScenarioTitle(...) replaces BDDfy class-named titles with the method's name as a sentence. Since 5.16.5 both keep a word written in capitals ([[Step Tracking › Method Name Humanization
PlantUmlCreator Converts RequestResponseLog entries into PlantUML sequence diagram code.
PlantUmlTextEncoder Encodes PlantUML text to URL-safe format for server rendering.
InternalFlowSegment Record: RequestResponseId, BoundaryType, TestId, StartTime, EndTime, Spans. Represents a segment of internal flow between two consecutive HTTP boundaries. FlowSpans (4.4.0) is every span of the segment as internal flow draws it, whatever recorded it; Spans holds the ones that are activities of this process, and is empty for an ingest's spans. Setting Spans (a with expression) sets FlowSpans to them.
FlowSpan Record (4.4.0): TraceId, SpanId, ParentSpanId, Name, Source, StartTimeUtc, Duration, Service: a span as internal flow reads it. FlowSpan.From(activity) makes one of an Activity; OtlpSpan.ToFlowSpan() (Integration Otlp Extension) one of an exported span; IngestRequest.Spans takes them ([[Ingesting External Captures › Spans
InternalFlowSegmentBuilder Static class; BuildSegments(logs, spans) correlates OTel spans with HTTP boundary timestamps to produce a dictionary of segments keyed by iflow-{id}, one per request that is a call: a diagram marker or a user action gets none, since no arrow links it (from 3.31.4).
InternalFlowRenderer Static class; RenderActivityDiagram(segment) produces PlantUML activity diagram with swimlanes. RenderCallTree(segment) produces HTML nested list.
InternalFlowHtmlGenerator Static class; GenerateSegmentDataScript(segments, style) produces the <script id="iflow-segments" type="application/json"> element holding the segment map gzipped and base64-encoded, and WrapSegmentData(map) wraps a map built already (both set window.__iflowSegments before 3.31.9).
InternalFlowSpanCollector Static class; CollectSpans(granularity, sources) loads spans from InternalFlowSpanStore and filters by granularity.
InternalFlowSpanStore Static class; thread-safe ConcurrentQueue<Activity> store in core package. Add(Activity), Complete(Activity?) (stops + adds), GetSpans(), Clear(). Deduplicates by reference identity. Both InternalFlowActivityListener and TestTrackingSpanExporter write here.
InternalFlowActivityListener Sealed class implementing IDisposable; wraps System.Diagnostics.ActivityListener with AllData sampling. Auto-started on first use (process-wide singleton): by TestTrackingMessageHandler on its first SendAsync, by GrpcTrackingInterceptor on its first tracked call, and from 4.17.0 by a Kafka tracker on its first call. Captures well-known auto-instrumentation sources plus custom sources.
InternalFlowServiceCollectionExtensions Extension methods; AddActivityListenerForInternalFlowTracking(this IServiceCollection) registers an InternalFlowActivityListener for DI. Optional — auto-start covers the default case. The overload that takes params string[] never read its names and is obsolete from 5.34.0.
InternalFlowDiagramStyle Enum: ActivityDiagram, CallTree, SequenceDiagram. Controls the visual style of internal flow popup content.
InternalFlowDisplay Enum: Popup, Inline. Meant to control how internal flow content is shown; not implemented (every report uses the popup).
InternalFlowTrigger Enum: Click, Hover. Meant to control the user interaction that opens the popup; not implemented (a click opens it).
InternalFlowSpanGranularity Enum: AutoInstrumentation, Manual, Full. Controls which spans are included.
InternalFlowNoDataBehavior Enum: ShowMessage, HideLink, VisualDistinction. Controls behaviour when no spans exist for a segment; VisualDistinction is not implemented and behaves as ShowMessage.
InternalFlowContentStrategy Enum: Embedded, SeparateFragments. Meant to control how segment data is stored; not implemented (every report embeds it).
InternalFlowFlameChartPosition Enum: Underneath, BehindWithToggle. Controls flame chart positioning.
ActivitySourceDiscovery Static class; GetDiscoveredSources() returns a Dictionary<string, int> of all ActivitySource names that produced spans, with their counts. See Diagnostics and Debugging.
ReportDiagnostics Static class; Analyse(logs, features, includeSourceDiscovery) returns diagnostic warning strings, which a run prints to the console.
DiagnosticReportGenerator Static class; Generate(logs, features, options) produces DiagnosticReport.html with config dumps, log counts, unpaired requests, and activity source discovery. Only called when DiagnosticMode is true.
ReportGenerator Generates HTML and YAML report files from features, scenarios, and diagrams. CreateStandardReportsWithDiagrams() is the main entry point; also exposes GenerateHtmlReport(), GenerateSpecificationsData(), GenerateTestRunReportData() (whose optional shapeTemplates, 5.19.0, writes a run's HistoryShapeTemplates into the file as its shapeTemplates block), and GenerateTestRunReportSchema() for custom pipelines. The ReportFormatVersion constant (3.1.0, currently 1) is the version of the data file's shape, written as the first key, element or line of TestRunReport.json / .xml / .yml. It is distinct from the Kronikol version that wrote the file: adding a key does not move it, changing what a key means or what type it holds does. kronikol query and kronikol merge refuse a file declaring a version they do not understand.
HtmlReportFile Static class (5.6.0), namespace Kronikol.Reports: reads the HTML reports Kronikol writes, for code that parses a page's markup itself, such as an HTML parser in a test. From 5.6.0 TestRunReport.html and Specifications.html are written compressed, so their markup is not in the file's text. IsCompressed(string html) is true for a compressed report page; ToPlain(string html) returns its plain page, every item in gzip and base64 as a page written before 5.6.0 holds it, returns any other page as it is, and throws InvalidDataException for a compressed page that is damaged; ReadPlain(string path) does the same for the file at path. kronikol decode TestRunReport.html -o plain.html is the same from the command line. See [[Generated Reports › The compressed page
Query.QueryCommand Static class (3.32.0), namespace Kronikol.Query, in the net10.0 build only: Run(IReadOnlyList<string> args, TextWriter out, TextWriter error) runs a kronikol query command line and returns its exit code, and PrintUsage(TextWriter) prints its help. The engine behind kronikol query and behind the query.cs each run writes beside its report, which binds to Run by reflection, so its signature holds within a major version. See Querying Reports.
DataFormat Enum: Json, Xml, Yaml. Format for generated report data files (Specifications.*, TestRunReport.*).
CiMetadata Record: Provider, BuildId, BuildNumber, Branch, CommitSha, PipelineName, PipelineUrl, RunUrl. Embedded in reports when CI environment is detected.
RunEnvironment Record (3.1.0): Os, Runtime — RuntimeInformation.OSDescription and FrameworkDescription, written to the data file as environment. RunEnvironment.Current computes this process's values once. Deliberately two fields and no more: a report is an artifact other people download, so the machine name, the user name and the environment block stay out of it. Together with CiMetadata this is what tells a downloaded TestRunReport.json which run it is. RunEnvironment.Unrecorded (3.4.0) is the marker for "nobody can say": the writers leave the environment key out entirely rather than fill it in with the writing process's own answer. kronikol merge uses it when its shards disagree, and kronikol ingest when the source file does not report one - a Cucumber Messages source usually does, in its meta envelope, and that is what an ingested report now records.
Feature Record: DisplayName, Description?, Endpoint?, Tags? (string[]: the feature's own tags, which count for each of its scenarios; 5.0.0, in place of Labels), Scenarios[].
Scenario Record: Id, DisplayName, IsHappyPath, Result, Duration? (TimeSpan), ErrorMessage?, ErrorStackTrace?, FailureCause? (3.1.0 — the framework's own name for what went wrong, e.g. xUnit v3's Assert.Equal() Failure, kept out of ErrorMessage so it cannot become the thing failures are clustered by), Steps? (ScenarioStep[]), BackgroundSteps?, Tags? (string[]: the scenario's own tags, which the report puts after its feature's; 5.0.0, in place of Labels and Categories), Rule?, OutlineId? (string), ExampleValues?, Attachments?, NotATest (true for a scenario that is not a test, such as an ingest's fold: drawn like any scenario and counted as none; the data files write it as notATest, 5.2.6). BackgroundSteps contains common prefix steps extracted by BackgroundStepsDetector.
ScenarioTags Static class: the tag conventions every lane shares. Classify(tags) returns Classified(Tags, Endpoint, IsHappyPath): a leading @ and surrounding whitespace dropped, the first endpoint:x as the endpoint, a happy-path name as the flag, category:x as the tag x (CategoryPrefix), and every other name as a tag, each once. Before 5.0.0 Classified carried Labels and Categories. Comparer is the fold every lane and the report compare tags under (ASCII letters only, so Smoke and smoke are one tag); Merge(lists) gives the tags of every list in turn, each once, the first spelling kept; Shared(lists) the tags every list holds, in the first list's order and spelling; Normalise(tag) drops a leading @ and surrounding whitespace; EndpointPrefix is endpoint:. See [[Tags and Attributes › Tags
ScenarioStep Record representing a test scenario step with Keyword, Text, Status, Duration, BypassReason?, SubSteps[], Parameters[], Comments[], Attachments[], DocString?, DocStringMediaType?, TextSegments[].
BackgroundStepsDetector Static class, a guess for a producer with no source to read; DetectAndExtract(Scenario[]) groups scenarios by Rule, finds the longest common step prefix within each group, moves matched steps to Scenario.BackgroundSteps, each scenario keeping its own, and trims them from Scenario.Steps. No-op for single-scenario groups or groups with no common prefix. Detection only — the extracted steps render inline with the scenario's own unless SeparateBackgroundSteps is set. Note it assigns the same array instance to every scenario in a group. See [[Step Tracking › Background Steps
StepKeywordCollapser Static class; DisplayKeywords(IReadOnlyList<ScenarioStep>) returns the keyword to display for each step, substituting And where a step repeats the primary keyword in force. A render-time projection: it never mutates the steps, because the data writers run concurrently with the HTML one. Unrecognised (localised) keywords pass through and switch collapsing off until the next recognised primary.
StepParameter Record representing step parameters with Name, Kind (StepParameterKind), InlineValue?, TabularValue?, TreeValue?.
FileAttachment Record: Name, RelativePath. Represents a file attachment associated with a test step or scenario for inclusion in reports. Created via Track.Attachment() or framework-specific attachment APIs. See [[Step Tracking › File Attachments
WholeTestFlowVisualization Enum: None, FlameChart, ActivityDiagram, Both. Controls whole-test-flow visualization in the HTML report.
InternalFlowHasDataBehavior Enum: ShowLinkOnHover, ShowLink. Controls how internal flow links appear on diagram arrows when span data exists.
StringCasing Static class; Titleize(input), its one public conversion, writes a PascalCase or spaced name as title-cased words. A word with an apostrophe keeps it, with its first letter upper-cased (Month's, don't; 5.9.1, where Month's became Month S). Ported from Humanizer for zero-dependency usage. Up to 5.9.0 this page also listed Camelize, which is internal, and Underscore and Dasherize, which do not exist.
Stylesheets Constants class; HtmlReportStyleSheet (the base stylesheet every HTML report carries) and VioletThemeStyleSheet (the violet overlay on it that is the default HtmlSpecificationsCustomStyleSheet).
NodeJsPlantUmlRenderer Static class; Render(plantUml, format) renders PlantUML diagrams locally via Node.js. Downloads the PlantUML JS engine on first use and shells out to node. Requires node on PATH.
RequestResponseType Enum: Request, Response. Distinguishes request and response entries in RequestResponseLog.
OneOf<TOption1, TOption2> Discriminated union type. Wraps one of two possible values with IsOption1/IsOption2 and Match(). Used in configuration options that accept either a fixed value or a delegate.
ParameterGrouper Static class; GroupParameterizedScenarios(scenarios, maxColumns, titleize) groups test scenarios that share a method name but differ only in parameters into ParameterizedGroup tables.
ParameterizedGroup Record: MethodName, Scenarios[], ParameterNames[], DisplayRule. Holds grouped parameterized test cases for tabular display.
ParameterParser Static class; ExtractParameters(displayName) parses parameter names and values from xUnit/NUnit/TUnit display names.
ParameterDisplayRule Enum: Fallback, ScalarColumns. Controls whether parameters are shown as plain text or structured columns.
FailureClusterer Static class; Cluster(scenarios) groups the failed scenarios that share a key, the first line of the error message (for a Shouldly message, whose first line is the subject's code, the check on its second line too; for one Shouldly wrote without the caller's source, whose first line is the actual value, the check and the expected value, from 4.20.4), into the clusters of two or more that the report's failure section and Failures.md show.
ErrorDiffParser Static class; TryParseExpectedActual(errorMessage) extracts the expected and actual values of an equality from an assertion message, for the report's side-by-side diff and Failures.md: xUnit and NUnit (Expected: / Actual: or But was:), FluentAssertions (Expected result to be 5, but found 3., a string quoted) and Shouldly (should be / but was, a value bare unless it is a string, on one line or several, and from 4.20.4 its text without the caller's source: the actual value, should be, the expected value, but was not; from 4.22.3 either form with its options, should be with options: Ignoring case, or a collection's comparison, but was (case sensitive comparison), and the whole message where a text quotes it first, as an AggregateException's does). Null when the message holds no equality.
ComponentDiagramDiffer Static class; Compare() detects added/removed relationships and P95 performance regressions/improvements. GenerateDiffPlantUml() generates colour-coded diff diagrams.
RelationshipStats Record: CallCount, TestCount, MeanMs, MedianMs, P95Ms, P99Ms, MinMs, MaxMs, ErrorRate, StatusCodeDistribution, EndpointBreakdown, PayloadSizes, Concurrency, CV, MethodDistribution, Outliers, LatencyContributionPct. Performance statistics for a component relationship.
DependencyGraphMetrics Record: ServiceMetrics (fan-in/fan-out per service), CircularDependencies (Tarjan's SCC), LongestChain.
ComponentFlowSegmentBuilder Static class; ComputeRelationshipStats(), BuildRelationshipSegments(), ComputeErrorCorrelations(), ComputeCallOrderingPatterns(), ComputeGraphMetrics(). Advanced analytics on component relationships.
HttpRequestExtensions Extension methods on HttpRequest for extracting tracking headers and test identity from incoming requests.
StringExtensions Extension methods; ChunksUpTo(maxLength) splits strings into chunks, StringJoin(separator) joins enumerables, TrimEnd(suffix) trims a specific suffix.
ComponentDiagramReportGenerator Static class; GenerateComponentDiagramReport() produces .puml and .html files from tracked logs. Returns ComponentDiagramResult with file paths and raw PlantUML.
ComponentRelationship Record: Caller, Service, Protocol, Methods (HashSet), CallCount, TestCount. Represents a unique directional relationship between two participants.
ComponentDiagramOptions Record: FileName, EmbedInTestRunReport, Title, PlantUmlTheme, ParticipantFilter, RelationshipLabelFormatter. Configuration for component diagram generation.
CiEnvironment Enum: None, GitHubActions, AzureDevOps. Identifies the CI platform.
CiEnvironmentDetector Static class; Detect() returns the current CiEnvironment based on environment variables (GITHUB_ACTIONS, TF_BUILD).
CiSummaryGenerator Static class; GenerateMarkdown(features, diagrams, startTime, endTime, maxDiagrams) produces a failure-focused Markdown summary with embedded PlantUML image URLs. See CI Summary Integration.
CiSummaryWriter Static class; Write(markdown, environment) writes the summary to the CI platform ($GITHUB_STEP_SUMMARY for GitHub Actions, ##vso[task.uploadsummary] for Azure DevOps). See CI Summary Integration.
CiArtifactPublisher Static class; Publish(reportFilePaths, environment, artifactName, retentionDays) publishes report files as CI artifacts (##vso[artifact.upload] for Azure DevOps, $GITHUB_OUTPUT for GitHub Actions). See CI Artifact Upload.
ExecutionResult Enum: Passed, Failed, Skipped, Bypassed, SkippedAfterFailure. Bypassed is LightBDD-specific (step body ran, developer opted out). SkippedAfterFailure indicates cascading non-execution after a prior step failure.
RequestResponseMetaType Enum: Default, Event. Event means the call moves a message, and its note is drawn on the event card (the theme's --dg-event, rounded corners). Default is every other call. See Event-Annotations.
TestTrackingHttpHeaders Constants for tracking HTTP headers (test-tracking-ignore, test-tracking-current-test-name, etc.).
TrackingProxy<T> DispatchProxy-based generic wrapper; Create(target, options) wraps any interface for diagram tracking. Handles sync/async/void methods, serialises arguments and return values, supports ActivitySource spans, and logs via Immediate or Deferred mode. See Integration DispatchProxy Extension.
Track.Attachment() Static method; Attachment(filePath, name?) attaches a file to the current step (via StepCollector) or to the scenario when no step is active. Name defaults to the file name from filePath. Attachments render as <a class="step-attachment"> links in the report. See [[Step Tracking › File Attachments
TrackingProxyOptions Record: ServiceName (required), CallerName, ActivitySourceName?, UriScheme, SerializerOptions?, LogMode, CurrentTestInfoFetcher?. Configuration for TrackingProxy<T>.
TrackingLogMode Enum: Immediate, Deferred. Controls whether proxy logs are emitted immediately or queued for later flush.
TrackingSafeSerializer Static class; Serialize(value, options?) safely serialises objects for diagram content. Handles circular references, CancellationToken filtering, mock proxy detection, Task unwrapping, and configurable max depth with ToString() fallback.
TrackingSerializerOptions Class: MaxDepth (10), WriteIndented (true), UnwrapTasks (true), FilterCancellationTokens (true), SkipMockProxies (true), SkipTypes ([]).
TrackingTraceContext Static class; AsyncLocal<Guid?> trace scope. BeginTrace(out traceId) returns IDisposable that restores previous value. CreateParentContext() creates ActivityContext from trace ID bytes.
PendingRequestResponseLogs Static class; thread-safe deferred log queue. Enqueue(entry), FlushAll(testName, testId), Clear(), Count. Used with TrackingLogMode.Deferred.
PendingLogEntry Record: ServiceName, CallerName, Method, RequestContent?, ResponseContent?, Uri, StatusCode, ActivityTraceId?, ActivitySpanId?. Queue entry for deferred logging.
DeferredLogFlushHandler DelegatingHandler that calls PendingRequestResponseLogs.FlushAll() after each HTTP response. Use with CreateTestTrackingClient(options, new DeferredLogFlushHandler(options)).
TestTrackingServerBridge Static class; GetCurrentTestInfo(IHttpContextAccessor) reads test name and ID from HTTP headers on the server thread. Returns (string Name, string Id)?.
TestInfoResolver Static class; Resolve(IHttpContextAccessor?, Func<(string,string)>?) resolves test identity with httpContext-first + delegate fallback. CreateHttpFallbackFetcher(IHttpContextAccessor?, Func<(string,string)>) returns a Func<(string Name, string Id)> delegate encapsulating the dual-resolution pattern — eliminates the boilerplate httpContext dance when setting CurrentTestInfoFetcher.
ServiceCollectionDecoratorExtensions Extension methods; DecorateAll<TService>(Func<IServiceProvider, TService, TService>) wraps all registrations of TService with a decorator (removes original, adds decorated, preserves lifetime). DecorateAllOpen(Type openGenericServiceType, Type openGenericDecoratorType) scans for all closed-generic registrations matching an open generic type and replaces each with a decorator type, resolving additional constructor args from DI.

Integration Libraries

Each integration package provides the same set of framework-specific types:

Type Purpose
[Framework]TestTrackingMessageHandlerOptions Extends TestTrackingMessageHandlerOptions with auto-populated CurrentTestInfoFetcher.
CurrentTestInfo Static class with a Fetcher property (Func<(string Name, string Id)>) — the standard way to set CurrentTestInfoFetcher on any tracking options class. One per framework package. Outside a test it throws InvalidOperationException, which the trackers read as no test.
ServiceCollectionExtensions.TrackDependenciesForDiagrams() Registers tracking services in DI.
WebApplicationFactoryExtensions.CreateTestTrackingClient() Creates an HttpClient with the tracking handler attached. Also supports params DelegatingHandler[] additionalHandlers overload for chaining extra handlers (e.g. DeferredLogFlushHandler).
TrackingDiagramOverride Framework-specific wrapper that auto-resolves the test ID from the current test context. Outside a test its markers go to the test a TestIdentityScope or the global fallback names, and are dropped when neither names one; StartSetup() and StartAction() set the phase there either way, since the phase belongs to the flow (since 4.14.7; xUnit v3's sets none outside a test, and ReqNRoll's and LightBDD's throw outside a scenario).
[Framework]ReportGenerator Generates reports using framework-specific test metadata (xUnit ITestContext, NUnit TestContext, TUnit TestContext, BDDfy scenarios, ReqNRoll scenarios).

Deprecation note (v2.0.131+): The per-framework WebApplicationFactoryExtensions and ServiceCollectionExtensions classes are deprecated. Use the core Kronikol.WebApplicationFactoryExtensions and Kronikol.ServiceCollectionExtensions instead — they accept the base TestTrackingMessageHandlerOptions type, so any framework-specific options class works without a framework-specific extension method.

xUnit v2-specific:

Type Purpose
TestFrameworkExecutorExtensions Extension method; WithKronikolReporting(this ITestFrameworkExecutor executor) (since 4.12.0) wraps another xUnit v2 framework's executor, for a suite whose [assembly: TestFramework] names that framework, so the run writes Kronikol's reports as ReportingTestFramework does: each test with its own result, with the options in ReportLifecycle.Options. Wrapping an executor that already writes them (Kronikol's own, or one already wrapped) returns it unchanged. See [[Integration xUnit2 › Already using another test framework

BDDfy-specific:

Type Purpose
BDDfyDiagramsConfigurator Configure() registers BDDfy processors and the step-tracking executor, for diagram capture and for the steps that set a test's phase and its Setup/Action boundary.
BDDfyStepTrackingExecutor Custom IStepExecutor that opens a step for each BDDfy step, whose kind (GIVEN/WHEN/THEN) sets the test's phase and its Setup/Action boundary.
BDDfyScenarioCollector Thread-safe collector for BDDfy scenario metadata.
BDDfyScenarioInfo / BDDfyStepInfo Records for BDD scenario and step metadata.

ReqNRoll-specific:

Type Purpose
ReqNRollTrackingHooks Auto-registered [Binding] class with [BeforeScenario]/[AfterStep]/[AfterScenario] hooks.
ReqNRollScenarioCollector Thread-safe collector for ReqNRoll scenario metadata.
ReqNRollScenarioInfo / ReqNRollStepInfo Records for Gherkin scenario and step metadata.
ReqNRollConstants Constants for context keys and tag conventions. CategoryTagPrefix is gone in 5.0.0, since @category:x is the tag x.
ReqNRollReportEnhancer Post-processes ReqNRoll's native HTML report to inject sequence diagram attachments linked to each scenario's last step. Registered automatically by ReqNRollReportGenerator.
AttachmentCapturingOutputHelper Decorator for IReqnrollOutputHelper. Intercepts AddAttachment(filePath) and routes it through Track.Attachment() so Reqnroll attachments automatically appear in Kronikol reports.
AttachmentCapturingPlugin IRuntimePlugin that registers AttachmentCapturingOutputHelper at test thread initialization. Activated automatically via [assembly: RuntimePlugin] — no configuration needed.

CosmosDB Extension (Kronikol.Extensions.CosmosDB)

Class / Record / Enum Description
CosmosTrackingMessageHandler DelegatingHandler that intercepts Cosmos SDK HTTP traffic, classifies each request into a Cosmos operation, and logs it to RequestResponseLogger.
CosmosTrackingMessageHandlerOptions Configuration for the Cosmos tracking handler: service names, verbosity level, test info fetcher, excluded headers.
CosmosTrackingVerbosity Enum: Raw, Detailed, Summarised. Controls how much detail appears in diagram labels and notes.
CosmosOperation Enum: Create, Read, Replace, Patch, Delete, Upsert, Query, List, ExecStoredProc, Batch, Other.
CosmosOperationInfo Record: Operation, DatabaseName, CollectionName, DocumentId, QueryText. Returned by the classifier.
CosmosOperationClassifier Static class that classifies an HttpRequestMessage into a CosmosOperationInfo using HTTP method, URL path, and headers. Also provides GetDiagramLabel() for verbosity-aware label generation.
CosmosClientOptionsExtensions Extension methods WithTestTracking() and WithTestTrackingAndCustomSslValidation() on CosmosClientOptions.

See Integration CosmosDB Extension for setup and configuration.

EF Core Relational Extension (Kronikol.Extensions.EfCore.Relational)

Class / Record / Enum Description
SqlTrackingInterceptor DbCommandInterceptor that intercepts EF Core SQL commands, classifies each into a SQL operation, and logs it to RequestResponseLogger.
SqlTrackingInterceptorOptions Configuration for the SQL tracking interceptor: service names, verbosity level, test info fetcher, step type fetcher.
SqlTrackingVerbosity Enum: Raw, Detailed, Summarised. Controls how much detail appears in diagram labels and notes.
SqlOperation Enum: Select, Insert, Update, Delete, Merge, Upsert, StoredProc, Other.
SqlOperationInfo Record: Operation, TableName, CommandText. Returned by the classifier.
SqlOperationClassifier Static class that classifies SQL command text into a SqlOperationInfo. Handles all SQL dialects including SQL Server, PostgreSQL, MySQL, SQLite, Oracle, and Spanner. Also provides GetDiagramLabel() for verbosity-aware label generation and GetRawKeyword() for raw SQL keyword extraction.
DbContextOptionsBuilderExtensions Extension method WithSqlTestTracking() on DbContextOptionsBuilder.

See Integration EF Core Relational Extension for setup and configuration.

Redis Extension (Kronikol.Extensions.Redis)

Class / Record / Enum Description
RedisTrackingDatabase DispatchProxy-based IDatabase decorator that intercepts StackExchange.Redis operations, classifies each into a Redis operation with cache hit/miss detection, and logs it to RequestResponseLogger.
RedisTracker Core logging engine used by RedisTrackingDatabase. Logs Redis request/response pairs with classified labels and URIs. Can be used directly for custom integration scenarios.
RedisTrackingDatabaseOptions Configuration for the Redis tracking proxy: service names, verbosity level, test info fetcher, step type fetcher.
RedisTrackingVerbosity Enum: Raw, Detailed, Summarised. Controls how much detail appears in diagram labels and notes.
RedisOperation Enum: Get, Set, Delete, KeyExists, Expire, HashGet, HashSet, HashDelete, HashGetAll, ListPush, ListRange, SetAdd, SetMembers, Increment, Decrement, Publish, Other.
RedisCacheResult Enum: Hit, Miss, None. Classifies whether a read operation returned data (hit) or not (miss). Write operations use None.
RedisOperationInfo Record: Operation, CacheResult, Key, DatabaseNumber. Returned by the classifier.
RedisOperationClassifier Static class that classifies a Redis command name into a RedisOperationInfo with hit/miss detection. Also provides GetDiagramLabel() for verbosity-aware label generation (e.g. Get (Hit), Set, HashGet (Miss)).
DatabaseExtensions Extension methods WithRedisTestTracking() on IDatabase and GetTrackedDatabase() on IConnectionMultiplexer.

See Integration Redis Extension for setup and configuration.

PlantUML IKVM Extension (Kronikol.PlantUml.Ikvm)

Class Description
IkvmPlantUmlRenderer Static class; Render(string plantUml, PlantUmlImageFormat format) renders PlantUML text to PNG or SVG bytes locally via IKVM. No remote server or Java installation required. Use as the LocalDiagramRenderer delegate on DiagramsFetcherOptions or ReportConfigurationOptions.

See Integration PlantUML IKVM for setup and configuration.

OpenTelemetry Extension (Kronikol.Extensions.OpenTelemetry)

Class Description
OpenTelemetryTrackingExtensions Static class; AddTestTrackingExporter(this TracerProviderBuilder) registers a SimpleActivityExportProcessor with TestTrackingSpanExporter to capture spans into InternalFlowSpanStore.
TestTrackingSpanStore Backward-compatible static facade that delegates Add(), GetSpans(), and Clear() to InternalFlowSpanStore in the core package.
TestTrackingSpanExporter Internal BaseExporter<Activity> implementation that forwards completed spans to InternalFlowSpanStore.

See Integration OpenTelemetry Extension for setup and configuration.

DispatchProxy Extension (Kronikol.Extensions.DispatchProxy)

Class Description
ServiceCollectionTrackingExtensions Static class; ReplaceWithTracked<TService>(services, implementation, options) replaces a DI registration with a TrackingProxy<T> wrapper. Also has a simplified overload taking just serviceName.

See Integration DispatchProxy Extension for setup and configuration.

MediatR Extension (Kronikol.Extensions.MediatR)

Class / Record Description
MediatorTrackingExtensions Static class; TrackMediatorForDiagrams(services, options) replaces IMediator and ISender registrations with TrackingProxy wrappers.
MediatorTrackingOptions Record: ServiceName ("Application"), CallerName ("Caller"), ActivitySourceName?, LogMode, CurrentTestInfoFetcher?, SerializerOptions?.

See Integration MediatR Extension for setup and configuration.

gRPC Extension (Kronikol.Extensions.Grpc)

Class / Record Description
GrpcTrackingInterceptor Grpc.Core.Interceptors.Interceptor subclass that records all 5 gRPC call types and puts the test identity into each call's metadata. Implements ITrackingComponent, with HasHttpContextAccessor (4.13.0+). Constructor: (GrpcTrackingOptions, IHttpContextAccessor?).
GrpcTrackingOptions Record: ServiceName, CallerName, Verbosity, CurrentTestInfoFetcher?, CurrentStepTypeFetcher?, UseProtoServiceNameInDiagram, HttpContextAccessor?, PropagateTestIdentity (default true, 4.13.0+), phase-aware properties.
GrpcTrackingChannel Static factory; Create(handler, baseAddress, options) and CreateWithChannel(...). Builds CallInvoker with tracking.
GrpcTrackingHttpHandlerExtensions Extension method; AsGrpcTrackingCallInvoker(handler, baseAddress, options).
GrpcChannelExtensions Extension method; WithTestTracking(channel, options) wraps a GrpcChannel with tracking.
GrpcWebApplicationFactoryExtensions CreateTestTrackingGrpcClient<TEntryPoint,TClient>(options) and WithChannel variant. Auto-resolves IHttpContextAccessor from factory.Services (v2.26.0+).
GrpcServiceCollectionExtensions Static class; AddTrackedGrpcClient<TClient>(handler, baseAddress, configure?) registers a singleton tracked gRPC client. Auto-resolves IHttpContextAccessor from DI (v2.26.0+).
GrpcResponseVersionHandler DelegatingHandler that fixes HTTP/1.1 → HTTP/2 response version for TestServer.
GrpcOperationClassifier Classifies method names and streaming types for diagram labels.
GrpcOperationInfo Record: Operation, ServiceName?, MethodName?, FullMethodName?.
GrpcOperation Enum: UnaryCall, ServerStreamingCall, ClientStreamingCall, DuplexStreamingCall.
GrpcTrackingVerbosity Enum: Raw, Detailed, Summarised.

See Integration Grpc Extension for setup and configuration.

Kafka Extension (Kronikol.Extensions.Kafka)

Class / Record Description
KafkaTracker Central logging helper for Kafka operations. Implements ITrackingComponent. Constructor: (KafkaTrackingOptions, IHttpContextAccessor?). LogProduce/LogConsume(KafkaOperationInfo, string? content) and LogSubscribe, LogUnsubscribe, LogCommit, LogFlush, LogTransaction(KafkaOperationInfo) log one instant each; from 4.17.0, TrackProduce<TKey,TValue>(topic or TopicPartition, Message<TKey,TValue>, KafkaOperation = Produce) returns a KafkaProduceTracking<TKey,TValue>, and TrackConsume<TKey,TValue>(ConsumeResult<TKey,TValue>?) returns the IDisposable scope a message is handled in, under a Kronikol.Kafka span, the consume answered when it is disposed.
KafkaProduceTracking<TKey,TValue> 4.17.0+. One produce being tracked: Message (the message to hand to Kafka), Delivered(DeliveryResult), Delivered(DeliveryReport), Failed(Exception), Sent(), Handler(Action<DeliveryReport>? then). Reports its outcome once.
KafkaTrackingOptions Class: ServiceName, CallerName, Verbosity, CurrentTestInfoFetcher?, CurrentStepTypeFetcher? (no effect), TrackProduce, TrackConsume, TrackSubscribe, TrackUnsubscribe, TrackCommit, TrackFlush, TrackTransactions, LogMessageKey, LogMessageValue, PropagateTestIdentity, PropagateTraceContext (4.17.0+), TraceMessageProcessing (4.18.0+), AutoCorrelateOnConsume, ConsumeKeyExtractor?, HttpContextAccessor? (4.11.0+), and the phase-aware SetupVerbosity, ActionVerbosity, TrackDuringSetup, TrackDuringAction.
TrackingKafkaProducer<TKey,TValue> Decorator implementing IProducer<TKey,TValue>. Wraps produce calls and delegates to KafkaTracker.
TrackingKafkaConsumer<TKey,TValue> Decorator implementing IConsumer<TKey,TValue>. Wraps consume/subscribe calls and delegates to KafkaTracker.
KafkaServiceCollectionExtensions Static class; AddKafkaProducerTestTracking<TKey,TValue>(options?) decorates all IProducer<TKey,TValue> registrations with tracking wrappers. AddKafkaConsumerTestTracking<TKey,TValue>(options?) decorates IConsumer<TKey,TValue>. AddKafkaConsumerFactoryTestTracking<TKey,TValue>(options?) and AddKafkaProducerFactoryTestTracking<TKey,TValue>(options?) register the default factory if none exists and decorate it. Each uses the container's IHttpContextAccessor when the options carry none.
KafkaOperationInfo Record: Operation, Topic?, Partition?, Offset?.
KafkaOperation Enum: Produce, ProduceAsync, Consume, Subscribe, Unsubscribe, Commit, Flush, InitTransactions, BeginTransaction, CommitTransaction, AbortTransaction, SendOffsetsToTransaction, Other.
KafkaTrackingInterceptor Static class: EnableConsumerTracking/EnableProducerTracking<TKey,TValue>(options, accessor?), Disable…, Reset(); the state .BuildTracked() and .Tracked() read.
KafkaBuildInterceptor Static class in Kronikol.Extensions.Kafka.BuildInterception: the same Enable…/Disable…/Reset(), plus EnableTracking<TKey,TValue>, with Build() itself intercepted (DependentProducerBuilder's too, from 4.17.0). The patches stay for the process.
KafkaTrackingVerbosity Enum: Raw, Detailed, Summarised.

See Integration Kafka Extension for setup and configuration.

Google Cloud Pub/Sub Extension (Kronikol.Extensions.PubSub)

Class / Record Description
PubSubTracker Central logging helper for Pub/Sub operations. Implements ITrackingComponent. Constructor: (PubSubTrackingOptions, IHttpContextAccessor?).
PubSubTrackingOptions Record: ServiceName, CallerName, Verbosity, CurrentTestInfoFetcher?, CurrentStepTypeFetcher?, phase-aware properties.
TrackingPublisherClient Wrapper around PublisherClient. Intercepts publish operations and delegates to PubSubTracker.
TrackingSubscriberClient Wrapper around SubscriberClient. Intercepts message handler callback and delegates to PubSubTracker.
PubSubServiceCollectionExtensions Static class; AddPubSubTestTracking(options?) registers a singleton PubSubTracker in DI with IHttpContextAccessor auto-resolved.
PubSubOperationInfo Record: Operation, TopicName?, SubscriptionName?, MessageCount?.
PubSubOperation Enum: Publish, PublishBatch, Pull, Acknowledge, ModifyAckDeadline, Receive, StartSubscriber, StopSubscriber, Other.
PubSubTrackingVerbosity Enum: Raw, Detailed, Summarised.

See Integration PubSub Extension for setup and configuration.

LightBDD-specific:

Type Purpose
ReportWritersConfigurationExtensions CreateStandardReportsWithDiagrams() extension methods. The LightBddConfiguration overload (xUnit v3 only) also registers automatic raw argument capture via ArgumentCaptureScenarioDecorator. The ReportWritersConfiguration overload is legacy and does not capture arguments.
ArgumentCaptureScenarioDecorator IScenarioDecorator (xUnit v3 only) that captures raw test method arguments during scenario execution for rich sub-table rendering. Registered automatically by the LightBddConfiguration.CreateStandardReportsWithDiagrams() overload.
LightBddDiagramsFetcher Wraps diagrams for LightBDD's DiagramAsCode type.

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