Show / Hide Table of Contents

Class TracingConfigBuilder

Used to configure the tracers used for Phobos.Tracing

Inheritance
object
TracingConfigBuilder
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Phobos.Actor.Configuration
Assembly: Phobos.Actor.dll
Syntax
public sealed class TracingConfigBuilder

Methods

AddCustomMessageFilter(IFilterRule)

Add a new message filter to the tracing ruleset.

Declaration
public TracingConfigBuilder AddCustomMessageFilter(IFilterRule rule)
Parameters
Type Name Description
IFilterRule rule

A new filer rule to use.

Returns
Type Description
TracingConfigBuilder

AddExcludeMessageFilter<T>()

Add a new message filter to the tracing ruleset - excludes all messages of type T.

Declaration
public TracingConfigBuilder AddExcludeMessageFilter<T>()
Returns
Type Description
TracingConfigBuilder
Type Parameters
Name Description
T

AddIncludeMessageFilter(Predicate<object>)

Add a new message filter to the tracing ruleset.

Declaration
public TracingConfigBuilder AddIncludeMessageFilter(Predicate<object> rule)
Parameters
Type Name Description
Predicate<object> rule

A new filer rule to use.

Returns
Type Description
TracingConfigBuilder

AddIncludeMessageFilter<T>()

Add a new message filter to the tracing ruleset - includes all messages of type T.

Declaration
public TracingConfigBuilder AddIncludeMessageFilter<T>()
Returns
Type Description
TracingConfigBuilder
Type Parameters
Name Description
T

DisableAllTracing()

Disables Phobos tracing entirely.

Can be overridden if there are subsequent calls to SetTraceUserActors(bool) or SetTraceSystemActors(bool), so make sure this is the final call on the builder.

Declaration
public TracingConfigBuilder DisableAllTracing()
Returns
Type Description
TracingConfigBuilder

IncludeMessagesAlreadyInTrace(bool)

When VerboseTracing(bool) is set to false, this setting will allow messages for which a NoDecision has been issued to be included in the trace if there is an active trace already in place.

This setting does nothing if VerboseTracing(bool) is set to true as those messages will already be included.

Declaration
public TracingConfigBuilder IncludeMessagesAlreadyInTrace(bool include)
Parameters
Type Name Description
bool include

Set this value to false if you want to exclude all messages that aren't explicitly matched by a filtering rule when VerboseTracing(bool) is disabled.

Returns
Type Description
TracingConfigBuilder
Remarks

Set this to false if you want to minimize the amount of tracing data produced by Phobos.

SetAppendLogsToTrace(bool)

Toggles the appending of logs recorded via ILoggingAdapter to the active span inside all actors, when present.

Declaration
public TracingConfigBuilder SetAppendLogsToTrace(bool enabled)
Parameters
Type Name Description
bool enabled

Toggle value.

Returns
Type Description
TracingConfigBuilder
Remarks

This can be used to significantly compress the size of traces generated by Phobos, at the cost of losing context for what the actors were doing while processing messages. This setting applies system-wide.

SetCreateTraceUponReceive(bool)

Toggles automatic span creation upon message processing on or off system-wide.

Declaration
public TracingConfigBuilder SetCreateTraceUponReceive(bool enabled)
Parameters
Type Name Description
bool enabled

Toggle value.

Returns
Type Description
TracingConfigBuilder
Remarks

Disabling this system-wide will require the user to create all spans manually via the UsableContext (for messages received with active trace enabled) and Tracer (to record new spans using Phobos' ActivitySource.)

SetLogMessageEvents(bool)

Toggles LogMessageEvents.

Declaration
public TracingConfigBuilder SetLogMessageEvents(bool enabled)
Parameters
Type Name Description
bool enabled

Toggle value.

Returns
Type Description
TracingConfigBuilder
Remarks

Disable this setting if you want to reduce the number of events created per-span when Phobos is automatically recording akka.msg.recv spans.

SetTraceActorLifecycle(bool)

Toggles the tracing of actor lifecycle (PreStart, PostStop, etc), actor creation, and actor termination.

Declaration
public TracingConfigBuilder SetTraceActorLifecycle(bool enabled)
Parameters
Type Name Description
bool enabled

Toggle value.

Returns
Type Description
TracingConfigBuilder

SetTraceAkkaPersistence(bool)

Toggles Akka.Persistence tracing on or off.

Declaration
public TracingConfigBuilder SetTraceAkkaPersistence(bool enabled)
Parameters
Type Name Description
bool enabled

Toggle value.

Returns
Type Description
TracingConfigBuilder

SetTraceAsk(bool)

Toggles TraceAsk.

Declaration
public TracingConfigBuilder SetTraceAsk(bool enabled)
Parameters
Type Name Description
bool enabled

Toggle value.

Returns
Type Description
TracingConfigBuilder
Remarks

Defaults to true, which allows Ask{T} operations to be traced.

SetTraceFilter(ITraceFilter)

This sets the ITraceFilter for the entire Phobos installation.

Overwrites all AddIncludeMessageFilter(Predicate<object>) and related calls. Only one ITraceFilter can be active at a time.

Declaration
public TracingConfigBuilder SetTraceFilter(ITraceFilter filter)
Parameters
Type Name Description
ITraceFilter filter

The ITraceFilter to use.

Returns
Type Description
TracingConfigBuilder

SetTraceSystemActors(bool)

Toggles tracing of all /system actors on or off.

Declaration
public TracingConfigBuilder SetTraceSystemActors(bool enabled)
Parameters
Type Name Description
bool enabled

Toggle value.

Returns
Type Description
TracingConfigBuilder
Remarks

Off by default.

SetTraceUserActors(bool)

Toggles tracing of all /user actors on or off.

Declaration
public TracingConfigBuilder SetTraceUserActors(bool enabled)
Parameters
Type Name Description
bool enabled

Toggle value.

Returns
Type Description
TracingConfigBuilder
Remarks

On by default. If this setting is off, then only actors that implement the IWithTracing interface will trace.

VerboseTracing(bool)

Enables or disables "verbose" tracing. Enabled by default.

When enabled, this allows new traces to begin for any message for which a NoDecision has been issued - meaning that no one has explicitly included or excluded this message.

Declaration
public TracingConfigBuilder VerboseTracing(bool beVerbose)
Parameters
Type Name Description
bool beVerbose

When true, enables verbose mode.

Returns
Type Description
TracingConfigBuilder
Remarks

Set this to false if you want to minimize the amount of tracing data produced by Phobos.

In this article

Phobos®

APM for Akka.NET Applications

© 2025 Petabridge®

All rights reserved

Product
  • Purchase Phobos
  • Contact Sales
  • Phobos Quick Start Guide
  • Phobos Features
  • API Documentation
  • Release Notes
Resources
  • Akka.NET Documentation
  • Petabridge Blog
  • Akka.NET Support Plans
  • Akka.NET Consulting Services
  • Akka.NET Training
Connect
  • Petabridge Website
  • GitHub
  • Twitter
  • LinkedIn
  • YouTube
  • Contact Us
Privacy Policy
Built with ♥ by Petabridge