Class PhobosActorSettings
Internal settings used to determine how we are going to trace or monitor a specific actor
Inheritance
Inherited Members
Namespace: Phobos.Actor.Configuration
Assembly: Phobos.Actor.dll
Syntax
public class PhobosActorSettings
Constructors
PhobosActorSettings(Boolean, Boolean, TraceFilteringSettings, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean)
Creates a new PhobosActorSettings instance.
Declaration
public PhobosActorSettings(bool trace, bool monitor, TraceFilteringSettings filterSettings = null, bool customFiltering = false, bool phobosNotInstalled = false, bool mailboxDepth = false, bool propagateSettingsToChildren = false, bool traceActorLifecycle = true, bool createTraceUponReceive = true, bool logMessageEvents = true)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | trace | Toggles tracing on or off for this actor. |
System.Boolean | monitor | Toggles monitoring on or off for this actor. |
TraceFilteringSettings | filterSettings | Determines how this actor filters incoming messages for tracing purposes. |
System.Boolean | customFiltering | When set to true, indicates that this actor is running with custom filtering. |
System.Boolean | phobosNotInstalled | Optional. Use to indicate when Akka.Remote is enabled that the actors on the other side of the network don't have Phobos installed. |
System.Boolean | mailboxDepth | Optional. When enabled turns on monitoring of the mailbox depth of this actor. |
System.Boolean | propagateSettingsToChildren | When set to true, propagates the current monitoring settings down to children. |
System.Boolean | traceActorLifecycle | When set to true, allow actors to trace their PreStart / PostRestart activities. |
System.Boolean | createTraceUponReceive | When set to true, actors will create traces automatically upon processing messages. |
System.Boolean | logMessageEvents | When set to true and when CreateTraceUponReceive is true, will automatically append |
Fields
Empty
Default settings - has instrumentation disabled by default.
Declaration
public static readonly PhobosActorSettings Empty
Field Value
Type | Description |
---|---|
PhobosActorSettings |
Properties
CreateTraceUponReceive
When set to false
, actors will not create new spans automatically during message processing.
This setting, when set to false
and when tracing is disabled will also prevent
UsableContext from being automatically propagated.
Declaration
public bool CreateTraceUponReceive { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
Used for noise control - developers who want to use this setting can manually create their own spans and propagate them through Phobos still. UsableContext will give you access to the context propagated from a previous trace - this can be used to create more usable spans.
HasCustomTraceFilteringSettings
Returns true
if this actor has filtering settings
that differ from the ActorSystem defaults.
Declaration
public bool HasCustomTraceFilteringSettings { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
LogMessageEvents
In Phobos 2.0 we introduced latency tracking which includes logging two discrete events on all automatically created Phobos spans:
- "waiting" - created when the message is first Tell(Object, IActorRef)
- "message" - created when the message is first processed by the actor and
contains the messages' content.
Turning this setting to "off" disables the productions of these events on all
akka.msg.recv
spans created by Phobos.
Declaration
public bool LogMessageEvents { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
Set to true
by default.
Monitor
If true
, this actor will monitor
Declaration
public bool Monitor { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
MonitorMailbox
Used to monitor the depth of the mailbox queue
Declaration
public bool MonitorMailbox { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
PhobosNotInstalled
Used when communicating with remote ActorSystem instances.
When true
, it means that Phobos is not installed on the target system.
Declaration
public bool PhobosNotInstalled { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
PropagateSettingsToChildren
Used in cases where we want to DISABLE tracing for an entire portion of the hierarchy.
Declaration
public bool PropagateSettingsToChildren { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Trace
If true
, this actor will use tracing on all message processing internally.
Declaration
public bool Trace { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
TraceActorLifecycle
When set to true
indicates that actors who are enabled for tracing
will trace their PreStart / PostRestart / PostStop / PreRestart activities.
Declaration
public bool TraceActorLifecycle { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
TraceFiltering
The settings used to filter incoming traces.
Declaration
public TraceFilteringSettings TraceFiltering { get; }
Property Value
Type | Description |
---|---|
TraceFilteringSettings |
Methods
ForSystemActors(TracingSettings, MonitoringSettings)
Creates a default configuration for /system actors
Declaration
public static PhobosActorSettings ForSystemActors(TracingSettings tracing, MonitoringSettings monitoring)
Parameters
Type | Name | Description |
---|---|---|
TracingSettings | tracing | The |
MonitoringSettings | monitoring | The |
Returns
Type | Description |
---|---|
PhobosActorSettings | Phobos default settings for /system actors. |
ForUserActors(TracingSettings, MonitoringSettings)
Creates a default configuration for /user actors
Declaration
public static PhobosActorSettings ForUserActors(TracingSettings tracing, MonitoringSettings monitoring)
Parameters
Type | Name | Description |
---|---|---|
TracingSettings | tracing | The |
MonitoringSettings | monitoring | The |
Returns
Type | Description |
---|---|
PhobosActorSettings | Phobos default settings for /user actors. |
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |
Overrides
WithCreateTraceUponReceive(Boolean)
Set to true
by default.
Creates message-processing spans automatically when tracing is enabled. When this setting is disabled users will be able to manually create traces from SpanContexts received during tracing and traces will still be propagated.
This setting, when set to false
and when tracing is disabled will also
prevent UsableContext from being automatically propagated.
Declaration
public PhobosActorSettings WithCreateTraceUponReceive(bool createSpanUponReceive)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | createSpanUponReceive |
Returns
Type | Description |
---|---|
PhobosActorSettings |
Remarks
REMARKS: this setting should really only be used when attempting to suppress large amounts of noise from the tracing system by manually controlling when traces are created.
WithFiltering(TraceFilteringSettings, Boolean)
Modifies the settings to change whether tracing is enabled or not.
Declaration
public PhobosActorSettings WithFiltering(TraceFilteringSettings filteringSettings, bool customTracing = true)
Parameters
Type | Name | Description |
---|---|---|
TraceFilteringSettings | filteringSettings | The tracing filtering settings. |
System.Boolean | customTracing | Optional. Defaults to |
Returns
Type | Description |
---|---|
PhobosActorSettings | An immutable replica of the original PhobosActorSettings instance. |
WithLogMessageEvents(Boolean)
In Phobos 2.0 we introduced latency tracking which includes logging two discrete events on all automatically created Phobos spans:
- "waiting" - created when the message is first Tell(Object, IActorRef)
- "message" - created when the message is first processed by the actor and
contains the messages' content.
Turning this setting to "off" disables the productions of these events on all
akka.msg.recv
spans created by Phobos.
Declaration
public PhobosActorSettings WithLogMessageEvents(bool logMessageEvents)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | logMessageEvents |
Returns
Type | Description |
---|---|
PhobosActorSettings |
Remarks
Set to true
by default. Set this value to false
to reduce the amount of data produced
per-span.
WithMonitoring(Boolean)
Modifies the settings to change whether monitoring is enabled or not.
Declaration
public PhobosActorSettings WithMonitoring(bool monitoring)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | monitoring | Toggles monitoring on or off. |
Returns
Type | Description |
---|---|
PhobosActorSettings | An immutable replica of the original PhobosActorSettings instance. |
WithPropagateToChildren(Boolean)
Modifies the settings to change whether or not we allow settings to propagate down to our children or not.
Declaration
public PhobosActorSettings WithPropagateToChildren(bool propagate)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | propagate | Toggles propagation on or off. |
Returns
Type | Description |
---|---|
PhobosActorSettings | An immutable replica of the original PhobosActorSettings instance. |
WithTracing(Boolean)
Modifies the settings to change whether tracing is enabled or not.
Declaration
public PhobosActorSettings WithTracing(bool tracing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | tracing | Toggles tracing on or off. |
Returns
Type | Description |
---|---|
PhobosActorSettings | An immutable replica of the original PhobosActorSettings instance. |