Documentation
¶
Index ¶
- Variables
- func Repeating[V any](ctx context.Context, deps ObserverDeps, handle TaggedHandle[V], ...)
- type AnyField
- type Emitter
- type Field
- type Flushable
- type FlushableType
- type Handle
- func Register[Value any, Tags any](registry Registry, name string, help string, metricType Type[Value], ...) Handle[Tags, Value]
- func RegisterFlushable[Value any, Tags any](registry Registry, name string, help string, metricType FlushableType[Value], ...) Handle[Tags, Value]
- func RegisterMultiField[Value any, Tags any](registry Registry, namePrefix string, helpPrefix string, ...) Handle[Tags, Value]
- type HttpArgs
- type HttpOptions
- type ObserverDeps
- type Registry
- type RegistryArgs
- type TaggedHandle
- type TagsDesc
- type Type
- func AsyncLatencyDurationHistogram() Type[time.Duration]
- func DurationGauge() Type[time.Duration]
- func DurationHistogram(buckets []float64) Type[time.Duration]
- func ExponentialIntHistogram(numBuckets int) Type[int]
- func FloatCounter() Type[float64]
- func FloatGauge() Type[float64]
- func FunctionDurationHistogram() Type[time.Duration]
- func Int32Gauge() Type[int32]
- func Int64Gauge() Type[int64]
- func IntCounter() Type[int]
- func IntGauge() Type[int]
- func IntHistogram(buckets []int) Type[int]
Constants ¶
This section is empty.
Variables ¶
View Source
var NewHttp = utilhttp.DeclareServer( func(HttpArgs) string { return "prometheus-http" }, defaultHttpPort, defaultHttpsPort, func(HttpArgs, *flag.FlagSet) HttpOptions { return HttpOptions{} }, func(_ HttpArgs, requests *component.DepRequests) httpDeps { return httpDeps{ comp: component.DepPtr(requests, newRegistry()), } }, func(_ HttpArgs, _ HttpOptions, deps httpDeps, mux *http.ServeMux) (*httpState, error) { mux.Handle("/", promhttp.HandlerFor(deps.comp.Get().PrometheusRegistry, promhttp.HandlerOpts{ Registry: deps.comp.Get().PrometheusRegistry, })) return &httpState{}, nil }, component.Lifecycle[HttpArgs, HttpOptions, httpDeps, httpState]{ Start: nil, Join: nil, HealthChecks: nil, }, func(HttpArgs, HttpOptions, httpDeps, *httpState) util.Empty { return util.Empty{} }, )
Functions ¶
func Repeating ¶
func Repeating[V any]( ctx context.Context, deps ObserverDeps, handle TaggedHandle[V], getter func() V, )
Types ¶
type AnyField ¶
type AnyField[StructType any] interface { InitFieldCollector(namePrefix string, helpPrefix string, tagKeys []string) prometheus.Collector EmitField(tagValues []string, value StructType) }
A type-erased interface for Field[StructType, *].
type Field ¶
type Field[StructType any, FieldType any] struct { Name string Help string MetricType Type[FieldType] Extractor func(StructType) FieldType }
func (Field[StructType, FieldType]) InitFieldCollector ¶
type FlushableType ¶
type Handle ¶
func RegisterFlushable ¶
func RegisterMultiField ¶
func (Handle[Tags, Value]) With ¶
func (handle Handle[Tags, Value]) With(tags Tags) TaggedHandle[Value]
type HttpOptions ¶
type HttpOptions struct{}
type ObserverDeps ¶
type ObserverDeps struct {
// contains filtered or unexported fields
}
func MakeObserverDeps ¶
func MakeObserverDeps(requests *component.DepRequests) ObserverDeps
func (ObserverDeps) Registry ¶
func (deps ObserverDeps) Registry() Registry
type Registry ¶
type Registry struct { Prometheus *prometheus.Registry // contains filtered or unexported fields }
type RegistryArgs ¶
type RegistryArgs struct{}
type TaggedHandle ¶
type TaggedHandle[Value any] struct { // contains filtered or unexported fields }
func (TaggedHandle[Value]) Emit ¶
func (handle TaggedHandle[Value]) Emit(value Value)
type TagsDesc ¶
func NewReflectTags ¶
type Type ¶
type Type[Value any] interface { InitCollector(name string, help string, tagKeys []string) prometheus.Collector Emitter[Value] }
func AsyncLatencyDurationHistogram ¶
A histogram measuring the latency of an asynchronous operation.
func DurationGauge ¶
func ExponentialIntHistogram ¶
func FloatCounter ¶
func FloatGauge ¶
func FunctionDurationHistogram ¶
A histogram measuring the time of a function execution.
func Int32Gauge ¶
func Int64Gauge ¶
func IntCounter ¶
func IntHistogram ¶
Click to show internal directories.
Click to hide internal directories.