Documentation
¶
Overview ¶
Package telemetry holds the tracing and metric helpers the engine, the plugin registry and the admin service share.
Spans go to the global OpenTelemetry tracer provider, which forge.New installs. Metrics go to a go-utils metrics.Metrics, which in a Forge app is app.Metrics(); Forge scrapes a name like shield_scans_completed_total as forge_shield_scans_completed_total.
Index ¶
Constants ¶
const ScopeName = "github.com/xraph/shield"
ScopeName is the instrumentation scope on every span shield starts.
Variables ¶
This section is empty.
Functions ¶
func ErrorType ¶
ErrorType returns the Go type of the innermost error in err's chain, the value for the exception.type attribute.
func Exception ¶
Exception adds an exception event that carries only the error's Go type, for a failure that doesn't fail the span as a whole.
Types ¶
type CounterVec ¶
type CounterVec struct {
// contains filtered or unexported fields
}
CounterVec is a counter with fixed label keys. A nil *CounterVec records nothing, which is what NewCounterVec returns for a nil sink.
func NewCounterVec ¶
func NewCounterVec(m gometrics.Metrics, name, help string, keys ...string) *CounterVec
NewCounterVec declares a counter on m. A nil m returns nil.
func (*CounterVec) Inc ¶
func (c *CounterVec) Inc(values ...string)
Inc adds one to the series for values, given in the declared key order. A call with the wrong number of values records nothing.
type HistogramVec ¶
type HistogramVec struct {
// contains filtered or unexported fields
}
HistogramVec is a histogram with fixed label keys. A nil *HistogramVec records nothing, which is what NewHistogramVec returns for a nil sink.
func NewHistogramVec ¶
func NewHistogramVec(m gometrics.Metrics, name, help, unit string, buckets []float64, keys ...string) *HistogramVec
NewHistogramVec declares a histogram on m with the given unit and buckets. A nil m returns nil.
func (*HistogramVec) Observe ¶
func (h *HistogramVec) Observe(v float64, values ...string)
Observe records v in the series for values, given in the declared key order. A call with the wrong number of values records nothing.