Navigation
API > API/Runtime > API/Runtime/Analytics
IAnalyticsSpan Interface
Inspired by OpenTelemety model for Tracer/Span. A span should be used to measure long running actions. It can be thought of as hierarchical timer object. A span capture event state within an array of EventAattributes and emit them with every event sent from this span A span can only be started via a IAnalyticsTracer interface, but can be Ended on demand Spans are arranged hierarchically and the expected behavior is for the parent span to end the spans of its children on during it's own End call Elapsed time should be calculated on each call, but on when the span is active Will send telemetry events via the IAnalyticsProvider
| Name | IAnalyticsSpan |
| Type | class |
| Header File | /Engine/Source/Runtime/Analytics/Analytics/Public/Interfaces/IAnalyticsTracer.h |
| Include Path | #include "Interfaces/IAnalyticsTracer.h" |
Syntax
class IAnalyticsSpan : private FNoncopyable
Inheritance Hierarchy
- FNoncopyable → IAnalyticsSpan
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
IAnalyticsSpan
(
const FName Name |
Interfaces/IAnalyticsTracer.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~IAnalyticsSpan() |
Interfaces/IAnalyticsTracer.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AddAttributes
(
const TArray< FAnalyticsEventAttribute >& AdditionalAttributes |
Append attributes to this span context | Interfaces/IAnalyticsTracer.h | |
void End
(
const TArray< FAnalyticsEventAttribute >& AdditionalAttributes |
End this span | Interfaces/IAnalyticsTracer.h | |
const TArray< FAnalyticsEventAttribute > & GetAttributes() |
Get context attributes for the span | Interfaces/IAnalyticsTracer.h | |
double GetDuration() |
Get the span duration in seconds | Interfaces/IAnalyticsTracer.h | |
double GetElapsedTime() |
Get the elapsed time for the span in seconds | Interfaces/IAnalyticsTracer.h | |
FGuid GetId() |
Get unique Id? | Interfaces/IAnalyticsTracer.h | |
bool GetIsActive() |
Is the span active? | Interfaces/IAnalyticsTracer.h | |
const FName & GetName() |
Get the internal name for the span | Interfaces/IAnalyticsTracer.h | |
uint32 GetStackDepth() |
Get the scope depth for the span | Interfaces/IAnalyticsTracer.h | |
void RecordEvent
(
const FString& EventName, |
Record an event from this span, appends the attributes for the span context | Interfaces/IAnalyticsTracer.h | |
void SetProvider
(
TSharedPtr< IAnalyticsProvider > AnalyticsProvider |
Sets the analytics provider for the tracer | Interfaces/IAnalyticsTracer.h | |
void SetStackDepth
(
uint32 Depth |
Set the scope depth for the span | Interfaces/IAnalyticsTracer.h | |
void Start
(
const TArray< FAnalyticsEventAttribute >& AdditionalAttributes |
Start this span | Interfaces/IAnalyticsTracer.h |