Class TracingConfigBuilder
Used to configure the tracers used for Phobos.Tracing
Inheritance
Inherited Members
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 |
---|---|---|
System.Predicate<System.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(Boolean) or SetTraceSystemActors(Boolean), so make sure this is the final call on the builder.
Declaration
public TracingConfigBuilder DisableAllTracing()
Returns
Type | Description |
---|---|
TracingConfigBuilder |
IncludeMessagesAlreadyInTrace(Boolean)
When VerboseTracing(Boolean) 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(Boolean) is set to true
as
those messages will already be included.
Declaration
public TracingConfigBuilder IncludeMessagesAlreadyInTrace(bool include)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | include | Set this value to |
Returns
Type | Description |
---|---|
TracingConfigBuilder |
Remarks
Set this to false
if you want to minimize the amount of tracing data
produced by Phobos.
SetAppendLogsToTrace(Boolean)
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 |
---|---|---|
System.Boolean | 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(Boolean)
Toggles automatic span creation upon message processing on or off system-wide.
Declaration
public TracingConfigBuilder SetCreateTraceUponReceive(bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | 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' System.Diagnostics.ActivitySource.)
SetLogMessageEvents(Boolean)
Toggles LogMessageEvents.
Declaration
public TracingConfigBuilder SetLogMessageEvents(bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | 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(Boolean)
Toggles the tracing of actor lifecycle (PreStart, PostStop, etc) and actor creation.
Declaration
public TracingConfigBuilder SetTraceActorLifecycle(bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | enabled | Toggle value. |
Returns
Type | Description |
---|---|
TracingConfigBuilder |
Remarks
On by default. If this setting is off, Akka.Persistence recovery will not be traced nor any other actor startup activity.
SetTraceAkkaPersistence(Boolean)
Toggles Akka.Persistence tracing on or off.
Declaration
public TracingConfigBuilder SetTraceAkkaPersistence(bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | enabled | Toggle value. |
Returns
Type | Description |
---|---|
TracingConfigBuilder |
Remarks
Akka.Persistence.Recovery tracing also requires TraceActorLifecycle to be set to
true
in order to function correctly. However, leaving this setting on and that one off
means that you can still trace Persist operations without also tracing recoveries.
SetTraceAsk(Boolean)
Toggles TraceAsk.
Declaration
public TracingConfigBuilder SetTraceAsk(bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | 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(Boolean)
Toggles tracing of all /system actors on or off.
Declaration
public TracingConfigBuilder SetTraceSystemActors(bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | enabled | Toggle value. |
Returns
Type | Description |
---|---|
TracingConfigBuilder |
Remarks
Off by default.
SetTraceUserActors(Boolean)
Toggles tracing of all /user actors on or off.
Declaration
public TracingConfigBuilder SetTraceUserActors(bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | 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(Boolean)
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 |
---|---|---|
System.Boolean | beVerbose | When |
Returns
Type | Description |
---|---|
TracingConfigBuilder |
Remarks
Set this to false
if you want to minimize the amount of tracing data
produced by Phobos.