Documentation
¶
Index ¶
- Constants
- func FirstErr(err error) string
- func Float64CounterGetInstrument(name string, options ...metric_api.Float64CounterOption) (metric_api.Float64Counter, error)
- func FullErr(err error) string
- func GetHost(r *http.Request) string
- func GetMeter(buildinfo model.BuildInfo, log *slog.Logger) metric_api.Meter
- func Int64CounterGetInstrument(name string, options ...metric_api.Int64CounterOption) (metric_api.Int64Counter, error)
- func NoErr(error) string
- type ErrFormatter
- type InstrumentReg
Constants ¶
View Source
const ( // MetrAttrErr is the metric attribute for error MetrAttrErr = "error" MetrAttrMethod = "method" MetrAttrUrl = "url" MetrAttrStatus = "status" MetrAttrPathPattern = "path_pattern" MetrAttrPath = "path" MetrAttrHost = "host" MetrAttrService = "service" MetrAttrTargetService = "target_service" MetrHttpOut = "http_out" MetrHttpOutDescr = "HTTP out response" )
Variables ¶
This section is empty.
Functions ¶
func Float64CounterGetInstrument ¶
func Float64CounterGetInstrument(name string, options ...metric_api.Float64CounterOption) (metric_api.Float64Counter, error)
func FullErr ¶
FullErr returns the full error text. Be careful about the cardinality, if the error text has dynamic part(s) (see: Prometheus label)
func Int64CounterGetInstrument ¶
func Int64CounterGetInstrument(name string, options ...metric_api.Int64CounterOption) (metric_api.Int64Counter, error)
Types ¶
type ErrFormatter ¶
ErrFormatter is a func type to format metric error attribute
type InstrumentReg ¶
InstrumentReg stores the already registered instruments
func (*InstrumentReg[T, O]) GetInstrument ¶
func (r *InstrumentReg[T, O]) GetInstrument(name string, options ...O) (T, error)
GetInstrument registers a new instrument, otherwise returns the already created.
Click to show internal directories.
Click to hide internal directories.