Record Class ModellingTracingSettings

java.lang.Object
java.lang.Record
org.axonframework.modelling.tracing.configuration.ModellingTracingSettings
Record Components:
repositoryEnabled - whether the Repository is decorated with tracing
stateManagerEnabled - whether the StateManager is decorated with tracing
spanAttributesProviders - toggles for the built-in span attribute providers contributed by this module

public record ModellingTracingSettings(boolean repositoryEnabled, boolean stateManagerEnabled, ModellingTracingSettings.SpanAttributesProviders spanAttributesProviders) extends Record
Per-component on/off toggles for modelling tracing, read by ModellingTracingConfigurationEnhancer to decide which axon-modelling components to decorate.

When no instance is registered, every component defaults to enabled (enabledByDefault()). To adjust the toggles declaratively, register an instance as a component -- typically starting from the defaults and using the with* copy methods:


 configurer.componentRegistry(cr -> cr.registerComponent(
         ModellingTracingSettings.class,
         c -> ModellingTracingSettings.enabledByDefault().withStateManagerEnabled(false)));
 
Higher-level integrations (for example property-based configuration layers) register a translated instance on the application's behalf; an explicitly registered component always takes precedence.
Since:
5.3.0
Author:
Mateusz Nowak
  • Constructor Details

  • Method Details

    • enabledByDefault

      public static ModellingTracingSettings enabledByDefault()
      Returns the default settings, with every modelling component enabled for tracing and every built-in span attribute provider enabled.
      Returns:
      the all-enabled default settings
    • withRepositoryEnabled

      public ModellingTracingSettings withRepositoryEnabled(boolean repositoryEnabled)
      Returns a copy of these settings with repositoryEnabled() replaced by the given value.
      Parameters:
      repositoryEnabled - whether the Repository is decorated with tracing
      Returns:
      a copy of these settings with the given repositoryEnabled
    • withStateManagerEnabled

      public ModellingTracingSettings withStateManagerEnabled(boolean stateManagerEnabled)
      Returns a copy of these settings with stateManagerEnabled() replaced by the given value.
      Parameters:
      stateManagerEnabled - whether the StateManager is decorated with tracing
      Returns:
      a copy of these settings with the given stateManagerEnabled
    • withSpanAttributesProviders

      public ModellingTracingSettings withSpanAttributesProviders(ModellingTracingSettings.SpanAttributesProviders spanAttributesProviders)
      Returns a copy of these settings with spanAttributesProviders() replaced by the given value.
      Parameters:
      spanAttributesProviders - toggles for the built-in span attribute providers contributed by this module
      Returns:
      a copy of these settings with the given spanAttributesProviders
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • repositoryEnabled

      public boolean repositoryEnabled()
      Returns the value of the repositoryEnabled record component.
      Returns:
      the value of the repositoryEnabled record component
    • stateManagerEnabled

      public boolean stateManagerEnabled()
      Returns the value of the stateManagerEnabled record component.
      Returns:
      the value of the stateManagerEnabled record component
    • spanAttributesProviders

      public ModellingTracingSettings.SpanAttributesProviders spanAttributesProviders()
      Returns the value of the spanAttributesProviders record component.
      Returns:
      the value of the spanAttributesProviders record component