Rationalise interfaces for Spans and Transactions #2656
Closed
Description
Version 3.x.x Interfaces
erDiagram
NoOpSpan ||--|| ISpan : implements
SpanTracer ||--|| ISpan : implements
ISpan ||--|| ISpanData : implements
ISpan {
string Description
string Operation
SpanStatus Status
ISpan StartChild()
void Finish()
}
Span ||--|| ISpanData : implements
ISpanData ||--|| ISpanContext : implements
ISpanData ||--|| IHasTags : implements
ISpanData ||--|| IHasExtra : implements
ISpanContext ||--|| ITraceContext : implements
NoOpTransaction ||--|| ITransaction : implements
TransactionTracer ||--|| ISpan : implements
TransactionTracer ||--|| ITransaction : implements
TransactionTracer ||--|| IHasDistribution : implements
TransactionTracer ||--|| IHasTransactionNameSource : implements
TransactionTracer ||--|| IHasMeasurements : implements
ITransaction ||--|| ITransactionData : implements
ITransaction ||--|| ISpan : implements
ITransaction {
string Name
bool IsParentSampled
IReadOnlyCollection Spans
ISpan GetLastActiveSpan()
}
Transaction ||--|| ITransactionData : implements
Transaction ||--|| IHasDistribution : implements
Transaction ||--|| IHasTransactionNameSource : implements
Transaction ||--|| IHasMeasurements : implements
ITransactionData ||--|| ISpanData : implements
ITransactionData ||--|| ITransactionContext : implements
ITransactionData ||--|| IEventLike : implements
ITransactionContext ||--|| ISpanContext : implements
IEventLike ||--|| IHasBreadcrumbs : implements
IEventLike ||--|| IHasTags : implements
IEventLike ||--|| IHasExtra : implements
TransactionContext ||--|| SpanContext : implements
TransactionContext ||--|| ITransactionContext : implements
SpanContext ||--|| ITraceContext : implements
Opportunities to simplify
Remove interfaces that were planned for removal in v4.0
Various interfaces were added because we were unable to add properties to existing interfaces... they were never intended to be kept long term:
IHasMeasurements
: Merged IHasMeasurements into ISpanData #2659IHasDistribution
: Feat/4.0.0 deprecate IHasDistribution #2660IHasTransactionNameSource
: Merged IHasTransactionNameSource into ITransactionContext #2654
Remove empty interfaces
We could remove interfaces that don't have any properties or methods (unless they serve some useful function as marker interfaces).
ISpanContext
: Merged ISpanContext into ITraceContext #2668
Remove interfaces with only one implementation
IHasBreadcrumbs
is only implemented byIEventLike
Merge interfaces that share all the same implementors
IHasTags
andIHasExtra
could be merged as anything that implements one also implements the other. However we decided not to do this as it resulted in a pretty weird nonsense interface. See IHasTags and IHasExtra replaced with ITagsAndData #2675
That still leaves us with a slightly simpler problem to solve however:
erDiagram
NoOpSpan ||--|| ISpan : implements
SpanTracer ||--|| ISpan : implements
SpanTracer {
bool IsSentryRequest
TransactionTracer Transaction
void Unfinish()
}
ISpan ||--|| ISpanData : implements
ISpan {
string Description
string Operation
SpanStatus Status
ISpan StartChild()
void Finish()
}
Span ||--|| ISpanData : implements
ISpanData ||--|| ITraceContext : implements
ISpanData ||--|| IHasTags : implements
ISpanData ||--|| IHasExtra : implements
ISpanData {
DateTimeOffset StartTimestamp
DateTimeOffset EndTimestamp
bool IsFinished
SentryTraceHeader GetTraceHeader()
}
NoOpTransaction ||--|| ITransaction : implements
TransactionTracer ||--|| ISpan : implements
TransactionTracer ||--|| ITransaction : implements
TransactionTracer ||--|| ITransactionData : implements
TransactionTracer ||--|| ISpan : implements
TransactionTracer {
bool IsSentryRequest
double SampleRate
IReadOnlyCollection Spans
DynamicSamplingContext DynamicSamplingContext
ITransactionProfiler TransactionProfiler
void AddChildSpan()
ISpan GetLastActiveSpan()
}
ITransaction ||--|| ITransactionData : implements
ITransaction ||--|| ISpan : implements
ITransaction {
string Name
bool IsParentSampled
IReadOnlyCollection Spans
ISpan GetLastActiveSpan()
}
Transaction ||--|| ITransactionData : implements
Transaction {
SentryId EventId
double SampleRate
DynamicSamplingContext DynamicSamplingContext
ITransactionProfiler TransactionProfiler
IReadOnlyCollection Spans
void Redact()
void WriteTo()
Transaction FromJson()
}
ITransactionData ||--|| ISpanData : implements
ITransactionData ||--|| ITransactionContext : implements
ITransactionData ||--|| IEventLike : implements
ITransactionContext ||--|| ITraceContext : implements
IEventLike ||--|| IHasTags : implements
IEventLike ||--|| IHasExtra : implements
TransactionContext ||--|| SpanContext : implements
TransactionContext ||--|| ITransactionContext : implements
SpanContext ||--|| ITraceContext : implements
Metadata
Assignees
Labels
No labels
Activity