Documentation ¶
Index ¶
- type MessageLifecycle
- type Telemetry
- func (t *Telemetry) RecordError(ctx context.Context, err error)
- func (t *Telemetry) SetHTTPResponseAttributes(ctx context.Context, status int, contentLength int64)
- func (t *Telemetry) SetHTTPServerAttributes(ctx context.Context, r *http.Request, routePath string, clientIP string)
- func (t *Telemetry) SetJTI(ctx context.Context, jti domain.JwtJti)
- func (t *Telemetry) SetSubscriberAttributes(ctx context.Context, sl domain.SubscriberLocator)
- func (t *Telemetry) Shutdown(ctx context.Context)
- func (t *Telemetry) StartDaemonSpan(ctx context.Context, systemName, daemonName string) (context.Context, context.CancelFunc)
- func (t *Telemetry) StartHTTPSpan(ctx context.Context, isServer bool, r *http.Request) (context.Context, context.CancelFunc)
- func (t *Telemetry) StartMessageSpan(ctx context.Context, lifecycle MessageLifecycle, msg domain.Message) (context.Context, context.CancelFunc)
- func (t *Telemetry) StartStorageSpan(ctx context.Context, id domain.StorageID, operation string) (context.Context, context.CancelFunc)
- type TraceResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MessageLifecycle ¶
type MessageLifecycle int
MessageLifecycle of the domain.Message (in tracing aspect).
const ( // Send means sending message Send MessageLifecycle = iota // Fetch means client fetching Fetch // Acknowledge means client received span Acknowledge )
type Telemetry ¶
type Telemetry struct {
// contains filtered or unexported fields
}
Telemetry represents tracing/metrics system
func InitTelemetry ¶
func InitTelemetry(config *config.TelemetryConfig) (telemetry *Telemetry, err error)
InitTelemetry initialize telemetry facility
func NewEmptyTelemetry ¶
NewEmptyTelemetry creates no-op telemetry system
func (*Telemetry) RecordError ¶
RecordError add error event to current span.
func (*Telemetry) SetHTTPResponseAttributes ¶
SetHTTPResponseAttributes adds attributes of HTTP response
func (*Telemetry) SetHTTPServerAttributes ¶
func (t *Telemetry) SetHTTPServerAttributes(ctx context.Context, r *http.Request, routePath string, clientIP string)
SetHTTPServerAttributes adds attributes for incoming HTTP request
func (*Telemetry) SetSubscriberAttributes ¶
func (t *Telemetry) SetSubscriberAttributes(ctx context.Context, sl domain.SubscriberLocator)
SetSubscriberAttributes adds attributes of subscriber
func (*Telemetry) StartDaemonSpan ¶
func (t *Telemetry) StartDaemonSpan(ctx context.Context, systemName, daemonName string) (context.Context, context.CancelFunc)
StartDaemonSpan starts background task span
func (*Telemetry) StartHTTPSpan ¶
func (t *Telemetry) StartHTTPSpan(ctx context.Context, isServer bool, r *http.Request) (context.Context, context.CancelFunc)
StartHTTPSpan starts tracing span for incoming or outgoing HTTP call
func (*Telemetry) StartMessageSpan ¶
func (t *Telemetry) StartMessageSpan(ctx context.Context, lifecycle MessageLifecycle, msg domain.Message) (context.Context, context.CancelFunc)
StartMessageSpan starts DSPS message processing span
type TraceResult ¶
type TraceResult struct {
OT *ottesting.StubExporter
}
TraceResult contains stub tracing result.
func WithStubTracing ¶
func WithStubTracing(t *testing.T, f func(*Telemetry)) *TraceResult
WithStubTracing is testing utility to create stub Telemetry facility and returns captured spans.