Documentation
¶
Index ¶
- Constants
- Variables
- func InitExporter(ctx context.Context, opts *Options, memStore *cache.MemoryStore, ...) error
- func NewSpanFromContext(ctx context.Context, name string, opts ...trace.SpanStartOption) (context.Context, trace.Span)
- type ActiveKeyCounter
- type ErrorHandleFunc
- type InstrumentedRoundTripper
- type MetricsServer
- type Options
- type WrappedRegistry
Constants ¶
View Source
const ( ExporterInvalid uint8 = iota ExporterPrometheus ExporterJaeger ExporterOTLP ExporterStdout )
Variables ¶
View Source
var KeyEndpoint = attribute.Key(keyPrefix + "endpoint")
View Source
var KeyOrigin = attribute.Key(keyPrefix + "origin")
Functions ¶
func InitExporter ¶
func InitExporter(ctx context.Context, opts *Options, memStore *cache.MemoryStore, logEntry *logrus.Entry) error
InitExporter initialises configured metrics and/or trace exporter.
Types ¶
type ActiveKeyCounter ¶ added in v1.14.0
ActiveKeyCounter is implemented by rate limiters to report their active key count.
type ErrorHandleFunc ¶
type ErrorHandleFunc func(error)
func (ErrorHandleFunc) Handle ¶
func (f ErrorHandleFunc) Handle(err error)
type InstrumentedRoundTripper ¶ added in v1.14.0
type InstrumentedRoundTripper struct {
// contains filtered or unexported fields
}
InstrumentedRoundTripper wraps an http.RoundTripper with OpenTelemetry tracing and metrics. It creates a CLIENT span for each outgoing request, injects the trace context (traceparent) into request headers, records span attributes and metrics.
func NewInstrumentedRoundTripper ¶ added in v1.14.0
func NewInstrumentedRoundTripper(next http.RoundTripper) *InstrumentedRoundTripper
NewInstrumentedRoundTripper wraps the given RoundTripper with tracing and metrics instrumentation.
type MetricsServer ¶
type MetricsServer struct {
// contains filtered or unexported fields
}
func NewMetricsServer ¶
func NewMetricsServer(log *logrus.Entry, registry *WrappedRegistry, port int) *MetricsServer
func (*MetricsServer) Close ¶
func (m *MetricsServer) Close() error
func (*MetricsServer) ListenAndServe ¶
func (m *MetricsServer) ListenAndServe()
type WrappedRegistry ¶
type WrappedRegistry struct {
// contains filtered or unexported fields
}
func NewWrappedRegistry ¶
func NewWrappedRegistry(promRegistry *prom.Registry, labels ...*dto.LabelPair) *WrappedRegistry
func (*WrappedRegistry) Gather ¶
func (wr *WrappedRegistry) Gather() ([]*dto.MetricFamily, error)
func (*WrappedRegistry) MustRegister ¶
func (wr *WrappedRegistry) MustRegister(collector ...prom.Collector)
func (*WrappedRegistry) Register ¶
func (wr *WrappedRegistry) Register(collector prom.Collector) error
func (*WrappedRegistry) Unregister ¶
func (wr *WrappedRegistry) Unregister(collector prom.Collector) bool
Source Files
¶
Click to show internal directories.
Click to hide internal directories.