Documentation ¶
Overview ¶
Package oteleventually provides extension components for eventually library to enable OpenTelemetry instrumentation.
Index ¶
Constants ¶
const ( EventStreamIDKey attribute.Key = "event_stream.id" EventStreamVersionSelectorKey attribute.Key = "event_stream.select_from_version" EventStreamExpectedVersionKey attribute.Key = "event_stream.expected_version" EventStoreNumEventsKey attribute.Key = "event_store.num_events" )
Attribute keys used by the InstrumentedEventStore instrumentation.
const ( ErrorAttribute attribute.Key = "error" AggregateTypeAttribute attribute.Key = "aggregate.type" AggregateVersionAttribute attribute.Key = "aggregate.version" AggregateIDAttribute attribute.Key = "aggregate.id" )
Attribute keys used by the InstrumentedRepository instrumentation.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InstrumentedEventStore ¶
type InstrumentedEventStore struct {
// contains filtered or unexported fields
}
InstrumentedEventStore is a wrapper type over an event.Store instance to provide instrumentation, in the form of metrics and traces using OpenTelemetry.
Use NewInstrumentedEventStore for constructing a new instance of this type.
func NewInstrumentedEventStore ¶
func NewInstrumentedEventStore(eventStore event.Store, options ...Option) (*InstrumentedEventStore, error)
NewInstrumentedEventStore returns a wrapper type to provide OpenTelemetry instrumentation (metrics and traces) around an event.Store.
An error is returned if metrics could not be registered.
func (*InstrumentedEventStore) Append ¶
func (ies *InstrumentedEventStore) Append( ctx context.Context, id event.StreamID, expected version.Check, events ...event.Envelope, ) (newVersion version.Version, err error)
Append calls the wrapped event.Store.Append method and records metrics and traces around it.
type InstrumentedRepository ¶
type InstrumentedRepository[I aggregate.ID, T aggregate.Root[I]] struct { // contains filtered or unexported fields }
InstrumentedRepository is a wrapper type over an aggregate.Repository instance to provide instrumentation, in the form of metrics and traces using OpenTelemetry.
Use NewInstrumentedRepository for constructing a new instance of this type.
func NewInstrumentedRepository ¶
func NewInstrumentedRepository[I aggregate.ID, T aggregate.Root[I]]( aggregateType aggregate.Type[I, T], repository aggregate.Repository[I, T], options ...Option, ) (*InstrumentedRepository[I, T], error)
NewInstrumentedRepository returns a wrapper type to provide OpenTelemetry instrumentation (metrics and traces) around an aggregate.Repository.
The aggregate.Type for the Repository is also used for reporting the Aggregate Type name as an attribute.
An error is returned if metrics could not be registered.
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option specifies instrumentation configuration options.
func WithMeterProvider ¶
func WithMeterProvider(provider metric.MeterProvider) Option
WithMeterProvider specifies the metric.MeterProvider instance to use for the instrumentation. By default, the global metric.MeterProvider is used.
func WithTracerProvider ¶
func WithTracerProvider(provider trace.TracerProvider) Option
WithTracerProvider specifies the trace.TracerProvider instance to use for the instrumentation. By default, the global trace.TracerProvider is used.