Documentation ¶
Index ¶
- type Factory
- type Observability
- func (o *Observability) Factory() Factory
- func (o *Observability) Logger() *slog.Logger
- func (o *Observability) Meter(name string, options ...metric.MeterOption) metric.Meter
- func (o *Observability) MetricsHandler() http.Handler
- func (o *Observability) PrometheusRegisterer() prometheus.Registerer
- func (o *Observability) Shutdown() error
- func (o *Observability) Tracer(name string, options ...trace.TracerOption) trace.Tracer
- func (o *Observability) TracerProvider() trace.TracerProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
func NewFactory ¶
NewFactory returns observability implementation fot test "t" based on (global) configuration (ie environment variables).
func (Factory) DefaultLogger ¶
DefaultLogger is a helper to get logger out of factory without needing to provide parameters (ie defaults are used) and handle error return value (panics in case of error).
func (Factory) DefaultObserver ¶
func (f Factory) DefaultObserver() observability.MeterAndTracer
DefaultObserver is a helper to get metrics and tracer out of factory without needing to provide parameters (ie defaults are used) and handle error return value (panics in case of error).
func (Factory) Observability ¶
func (f Factory) Observability(metrics, traces string) (observability.MeterAndTracer, error)
type Observability ¶
type Observability struct {
// contains filtered or unexported fields
}
func Default ¶
func Default(t *testing.T) *Observability
Default creates observability implementation based on environment variables.
func NOPObservability ¶
func NOPObservability() *Observability
NOP creates observability implementation where everything is no-op. Use it for tests for which it absolutely doesn't make sense to create any logs, traces or metrics.
func New ¶
func New(t *testing.T, metrics, traces string, logBuilder func(*logger.LogConfiguration) (*slog.Logger, error)) *Observability
func (*Observability) Factory ¶
func (o *Observability) Factory() Factory
func (*Observability) Logger ¶
func (o *Observability) Logger() *slog.Logger
func (*Observability) Meter ¶
func (o *Observability) Meter(name string, options ...metric.MeterOption) metric.Meter
func (*Observability) MetricsHandler ¶
func (o *Observability) MetricsHandler() http.Handler
func (*Observability) PrometheusRegisterer ¶
func (o *Observability) PrometheusRegisterer() prometheus.Registerer
func (*Observability) Shutdown ¶
func (o *Observability) Shutdown() error
func (*Observability) Tracer ¶
func (o *Observability) Tracer(name string, options ...trace.TracerOption) trace.Tracer
func (*Observability) TracerProvider ¶
func (o *Observability) TracerProvider() trace.TracerProvider