Record Class EventSourcingTracingSettings

java.lang.Object
java.lang.Record
org.axonframework.eventsourcing.tracing.configuration.EventSourcingTracingSettings
Record Components:
eventStoreEnabled - whether the EventStorageEngine is decorated with tracing
snapshotStoreEnabled - whether the SnapshotStore is decorated with tracing
spanAttributesProviders - toggles for the built-in span attribute providers contributed by this module

public record EventSourcingTracingSettings(boolean eventStoreEnabled, boolean snapshotStoreEnabled, EventSourcingTracingSettings.SpanAttributesProviders spanAttributesProviders) extends Record
Per-component on/off toggles for event-sourcing tracing, read by EventSourcingTracingConfigurationEnhancer to decide which axon-eventsourcing components to decorate, and by TracingEventTagsHandlerEnhancerDefinition to decide whether event handler spans are enriched with the event's tags.

When no instance is registered, every toggle 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(
         EventSourcingTracingSettings.class,
         c -> EventSourcingTracingSettings.enabledByDefault().withSnapshotStoreEnabled(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 EventSourcingTracingSettings enabledByDefault()
      Returns the default settings, with every event-sourcing tracing toggle enabled.
      Returns:
      the all-enabled default settings
    • eventTagsEnabled

      public boolean eventTagsEnabled()
      Returns:
      whether event tags are recorded as span attributes
    • withEventStoreEnabled

      public EventSourcingTracingSettings withEventStoreEnabled(boolean eventStoreEnabled)
      Returns a copy of these settings with eventStoreEnabled() replaced by the given value.
      Parameters:
      eventStoreEnabled - whether the EventStorageEngine is decorated with tracing
      Returns:
      a copy of these settings with the given eventStoreEnabled
    • withSnapshotStoreEnabled

      public EventSourcingTracingSettings withSnapshotStoreEnabled(boolean snapshotStoreEnabled)
      Returns a copy of these settings with snapshotStoreEnabled() replaced by the given value.
      Parameters:
      snapshotStoreEnabled - whether the SnapshotStore is decorated with tracing
      Returns:
      a copy of these settings with the given snapshotStoreEnabled
    • withSpanAttributesProviders

      public EventSourcingTracingSettings withSpanAttributesProviders(EventSourcingTracingSettings.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.
    • eventStoreEnabled

      public boolean eventStoreEnabled()
      Returns the value of the eventStoreEnabled record component.
      Returns:
      the value of the eventStoreEnabled record component
    • snapshotStoreEnabled

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

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