metrics

package
v0.19.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventContext

type EventContext struct {
	// contains filtered or unexported fields
}

func NewEventContext

func NewEventContext(span *trace.Span) *EventContext

func (*EventContext) HasDecision

func (e *EventContext) HasDecision() bool

func (*EventContext) Publish

func (e *EventContext) Publish()

func (*EventContext) SetDecision

func (e *EventContext) SetDecision(decision string)

func (*EventContext) SetError

func (e *EventContext) SetError(err error)

func (*EventContext) SetExtras

func (e *EventContext) SetExtras(extras any)

func (*EventContext) SetMode

func (e *EventContext) SetMode(mode string)

func (*EventContext) SetSLatency

func (e *EventContext) SetSLatency(duration time.Duration)

func (*EventContext) SetScore added in v0.19.0

func (e *EventContext) SetScore(score float64, label string)

SetScore records the detection score and its label on the metrics span. The label is what the analytics Security Engine breakdown groups by, so security plugins should pass the detected category (e.g. the moderation category or the guard signal type) rather than a plugin-internal identifier.

func (*EventContext) SetStatusCode

func (e *EventContext) SetStatusCode(code int)

Directories

Path Synopsis
Package playground stores the metrics Event of playground proxy requests in Redis so the dashboard can fetch the trace by TraceID (the X-AG-Trace-Id echoed in the proxy response).
Package playground stores the metrics Event of playground proxy requests in Redis so the dashboard can fetch the trace by TraceID (the X-AG-Trace-Id echoed in the proxy response).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL