Record Class EventSourcingTracingSettings
java.lang.Object
java.lang.Record
org.axonframework.eventsourcing.tracing.configuration.EventSourcingTracingSettings
- Record Components:
eventStoreEnabled- whether theEventStorageEngineis decorated with tracingsnapshotStoreEnabled- whether theSnapshotStoreis decorated with tracingspanAttributesProviders- 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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordToggles for the built-inSpanAttributesProviderscontributed by theaxon-eventsourcingmodule (read byEventSourcingSpanAttributesProviderConfigurationEnhancerandTracingEventTagsHandlerEnhancerDefinition). -
Constructor Summary
ConstructorsConstructorDescriptionEventSourcingTracingSettings(boolean eventStoreEnabled, boolean snapshotStoreEnabled, EventSourcingTracingSettings.SpanAttributesProviders spanAttributesProviders) Creates an instance of aEventSourcingTracingSettingsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic EventSourcingTracingSettingsReturns the default settings, with every event-sourcing tracing toggle enabled.final booleanIndicates whether some other object is "equal to" this one.booleanReturns the value of theeventStoreEnabledrecord component.booleanConvenience accessor forEventSourcingTracingSettings.SpanAttributesProviders.eventTagsEnabled().final inthashCode()Returns a hash code value for this object.booleanReturns the value of thesnapshotStoreEnabledrecord component.Returns the value of thespanAttributesProvidersrecord component.final StringtoString()Returns a string representation of this record class.withEventStoreEnabled(boolean eventStoreEnabled) Returns a copy of these settings witheventStoreEnabled()replaced by the given value.withSnapshotStoreEnabled(boolean snapshotStoreEnabled) Returns a copy of these settings withsnapshotStoreEnabled()replaced by the given value.withSpanAttributesProviders(EventSourcingTracingSettings.SpanAttributesProviders spanAttributesProviders) Returns a copy of these settings withspanAttributesProviders()replaced by the given value.
-
Constructor Details
-
EventSourcingTracingSettings
public EventSourcingTracingSettings(boolean eventStoreEnabled, boolean snapshotStoreEnabled, EventSourcingTracingSettings.SpanAttributesProviders spanAttributesProviders) Creates an instance of aEventSourcingTracingSettingsrecord class.- Parameters:
eventStoreEnabled- the value for theeventStoreEnabledrecord componentsnapshotStoreEnabled- the value for thesnapshotStoreEnabledrecord componentspanAttributesProviders- the value for thespanAttributesProvidersrecord component
-
-
Method Details
-
enabledByDefault
Returns the default settings, with every event-sourcing tracing toggle enabled.- Returns:
- the all-enabled default settings
-
eventTagsEnabled
public boolean eventTagsEnabled()Convenience accessor forEventSourcingTracingSettings.SpanAttributesProviders.eventTagsEnabled().- Returns:
- whether event tags are recorded as span attributes
-
withEventStoreEnabled
Returns a copy of these settings witheventStoreEnabled()replaced by the given value.- Parameters:
eventStoreEnabled- whether theEventStorageEngineis decorated with tracing- Returns:
- a copy of these settings with the given
eventStoreEnabled
-
withSnapshotStoreEnabled
Returns a copy of these settings withsnapshotStoreEnabled()replaced by the given value.- Parameters:
snapshotStoreEnabled- whether theSnapshotStoreis 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 withspanAttributesProviders()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
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
eventStoreEnabled
public boolean eventStoreEnabled()Returns the value of theeventStoreEnabledrecord component.- Returns:
- the value of the
eventStoreEnabledrecord component
-
snapshotStoreEnabled
public boolean snapshotStoreEnabled()Returns the value of thesnapshotStoreEnabledrecord component.- Returns:
- the value of the
snapshotStoreEnabledrecord component
-
spanAttributesProviders
Returns the value of thespanAttributesProvidersrecord component.- Returns:
- the value of the
spanAttributesProvidersrecord component
-