Documentation
¶
Index ¶
- Constants
- Variables
- func CountingListener(l net.Listener, g prometheus.Gauge) net.Listener
- func InitConfig(cfg Config)
- func InstrumentGrpc(svrMetrics *GRPCServerMetrics) []grpc.ServerOption
- func StreamServerInstrument(hist *prometheus.HistogramVec) grpc.StreamServerInterceptor
- func UnaryServerInstrument(hist *prometheus.HistogramVec) grpc.UnaryServerInterceptor
- type Config
- type GRPCServerMetrics
- type GrpcStatsHandler
- func (g *GrpcStatsHandler) HandleConn(_ context.Context, _ stats.ConnStats)
- func (g *GrpcStatsHandler) HandleRPC(ctx context.Context, rpcStats stats.RPCStats)
- func (g *GrpcStatsHandler) TagConn(ctx context.Context, _ *stats.ConnTagInfo) context.Context
- func (g *GrpcStatsHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) context.Context
- type HTTPServerMetrics
- type InstrumentHandler
- type OnceUponATimer
- type PrometheusMetrics
- func (pm *PrometheusMetrics) DeleteClass(className string) error
- func (pm *PrometheusMetrics) DeleteShard(className, shardName string) error
- func (pm *PrometheusMetrics) FinishLoadingShard(className string) error
- func (pm *PrometheusMetrics) FinishUnloadingShard(className string) error
- func (pm *PrometheusMetrics) NewUnloadedshard(className string) error
- func (pm *PrometheusMetrics) StartLoadingShard(className string) error
- func (pm *PrometheusMetrics) StartUnloadingShard(className string) error
- type TenantOffloadMetrics
Constants ¶
const (
DefaultMetricsNamespace = "weaviate"
)
Variables ¶
var ( // LatencyBuckets is default histogram bucket for response time (in seconds). // It also includes request that served *very* fast and *very* slow LatencyBuckets = []float64{.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10, 25, 50, 100} )
Functions ¶
func CountingListener ¶ added in v1.27.12
func InitConfig ¶ added in v1.19.7
func InitConfig(cfg Config)
func InstrumentGrpc ¶ added in v1.27.10
func InstrumentGrpc(svrMetrics *GRPCServerMetrics) []grpc.ServerOption
InstrumentGrpc accepts server metrics and returns the few `[]grpc.ServerOption` which you can then wrap it with any `grpc.Server` to get these metrics instrumented automatically.
```
svrMetrics := monitoring.NewGRPCServerMetrics(metrics, prometheus.DefaultRegisterer) grpcServer := grpc.NewServer(monitoring.InstrumentGrpc(*svrMetrics)...) grpcServer.Serve(listener)
```
func StreamServerInstrument ¶ added in v1.27.10
func StreamServerInstrument(hist *prometheus.HistogramVec) grpc.StreamServerInterceptor
func UnaryServerInstrument ¶ added in v1.27.10
func UnaryServerInstrument(hist *prometheus.HistogramVec) grpc.UnaryServerInterceptor
Types ¶
type Config ¶ added in v1.24.8
type Config struct { Enabled bool `json:"enabled" yaml:"enabled" long:"enabled"` Tool string `json:"tool" yaml:"tool"` Port int `json:"port" yaml:"port" long:"port" default:"8081"` Group bool `json:"group_classes" yaml:"group_classes"` MonitorCriticalBucketsOnly bool `json:"monitor_critical_buckets_only" yaml:"monitor_critical_buckets_only"` // Metrics namespace group the metrics with common prefix. MetricsNamespace string `json:"metrics_namespace" yaml:"metrics_namespace" long:"metrics_namespace" default:""` }
type GRPCServerMetrics ¶ added in v1.27.12
type GRPCServerMetrics struct { RequestDuration *prometheus.HistogramVec RequestBodySize *prometheus.HistogramVec ResponseBodySize *prometheus.HistogramVec InflightRequests *prometheus.GaugeVec }
GRPCServerMetrics exposes set of prometheus metrics for grpc servers.
func NewGRPCServerMetrics ¶ added in v1.27.12
func NewGRPCServerMetrics(namespace string, reg prometheus.Registerer) *GRPCServerMetrics
type GrpcStatsHandler ¶ added in v1.27.10
type GrpcStatsHandler struct {
// contains filtered or unexported fields
}
func NewGrpcStatsHandler ¶ added in v1.27.10
func NewGrpcStatsHandler(inflight *prometheus.GaugeVec, requestSize *prometheus.HistogramVec, responseSize *prometheus.HistogramVec) *GrpcStatsHandler
func (*GrpcStatsHandler) HandleConn ¶ added in v1.27.10
func (g *GrpcStatsHandler) HandleConn(_ context.Context, _ stats.ConnStats)
func (*GrpcStatsHandler) HandleRPC ¶ added in v1.27.10
func (g *GrpcStatsHandler) HandleRPC(ctx context.Context, rpcStats stats.RPCStats)
func (*GrpcStatsHandler) TagConn ¶ added in v1.27.10
func (g *GrpcStatsHandler) TagConn(ctx context.Context, _ *stats.ConnTagInfo) context.Context
func (*GrpcStatsHandler) TagRPC ¶ added in v1.27.10
func (g *GrpcStatsHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) context.Context
type HTTPServerMetrics ¶ added in v1.27.12
type HTTPServerMetrics struct { TCPActiveConnections *prometheus.GaugeVec RequestDuration *prometheus.HistogramVec RequestBodySize *prometheus.HistogramVec ResponseBodySize *prometheus.HistogramVec InflightRequests *prometheus.GaugeVec }
HTTPServerMetrics exposes set of prometheus metrics for http servers.
func NewHTTPServerMetrics ¶ added in v1.27.12
func NewHTTPServerMetrics(namespace string, reg prometheus.Registerer) *HTTPServerMetrics
NewHTPServerMetrics return the ServerMetrics that can be used in any of the grpc or http servers.
type InstrumentHandler ¶ added in v1.27.12
type InstrumentHandler struct {
// contains filtered or unexported fields
}
func InstrumentHTTP ¶ added in v1.27.12
func InstrumentHTTP( next http.Handler, context *middleware.Context, inflight *prometheus.GaugeVec, duration *prometheus.HistogramVec, requestSize *prometheus.HistogramVec, responseSize *prometheus.HistogramVec, ) *InstrumentHandler
func (*InstrumentHandler) ServeHTTP ¶ added in v1.27.12
func (i *InstrumentHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type OnceUponATimer ¶
type OnceUponATimer struct { sync.Once Timer *prometheus.Timer }
func NewOnceTimer ¶
func NewOnceTimer(promTimer *prometheus.Timer) *OnceUponATimer
func (*OnceUponATimer) ObserveDurationOnce ¶
func (o *OnceUponATimer) ObserveDurationOnce()
type PrometheusMetrics ¶
type PrometheusMetrics struct { BatchTime *prometheus.HistogramVec BatchSizeBytes *prometheus.SummaryVec BatchSizeObjects prometheus.Summary BatchSizeTenants prometheus.Summary BatchDeleteTime *prometheus.SummaryVec BatchCount *prometheus.CounterVec BatchCountBytes *prometheus.CounterVec ObjectsTime *prometheus.SummaryVec LSMBloomFilters *prometheus.SummaryVec AsyncOperations *prometheus.GaugeVec LSMSegmentCount *prometheus.GaugeVec LSMObjectsBucketSegmentCount *prometheus.GaugeVec LSMCompressedVecsBucketSegmentCount *prometheus.GaugeVec LSMSegmentCountByLevel *prometheus.GaugeVec LSMSegmentObjects *prometheus.GaugeVec LSMSegmentSize *prometheus.GaugeVec LSMMemtableSize *prometheus.GaugeVec LSMMemtableDurations *prometheus.SummaryVec ObjectCount *prometheus.GaugeVec QueriesCount *prometheus.GaugeVec RequestsTotal *prometheus.GaugeVec QueriesDurations *prometheus.HistogramVec QueriesFilteredVectorDurations *prometheus.SummaryVec QueryDimensions *prometheus.CounterVec QueryDimensionsCombined prometheus.Counter GoroutinesCount *prometheus.GaugeVec BackupRestoreDurations *prometheus.SummaryVec BackupStoreDurations *prometheus.SummaryVec BucketPauseDurations *prometheus.SummaryVec BackupRestoreClassDurations *prometheus.SummaryVec BackupRestoreBackupInitDurations *prometheus.SummaryVec BackupRestoreFromStorageDurations *prometheus.SummaryVec BackupRestoreDataTransferred *prometheus.CounterVec BackupStoreDataTransferred *prometheus.CounterVec // offload metric QueueSize *prometheus.GaugeVec QueueDiskUsage *prometheus.GaugeVec QueuePaused *prometheus.GaugeVec QueueCount *prometheus.GaugeVec QueuePartitionProcessingDuration *prometheus.HistogramVec VectorIndexQueueInsertCount *prometheus.CounterVec VectorIndexQueueDeleteCount *prometheus.CounterVec VectorIndexTombstones *prometheus.GaugeVec VectorIndexTombstoneCleanupThreads *prometheus.GaugeVec VectorIndexTombstoneCleanedCount *prometheus.CounterVec VectorIndexTombstoneUnexpected *prometheus.CounterVec VectorIndexTombstoneCycleStart *prometheus.GaugeVec VectorIndexTombstoneCycleEnd *prometheus.GaugeVec VectorIndexTombstoneCycleProgress *prometheus.GaugeVec VectorIndexOperations *prometheus.GaugeVec VectorIndexDurations *prometheus.SummaryVec VectorIndexSize *prometheus.GaugeVec VectorIndexMaintenanceDurations *prometheus.SummaryVec VectorDimensionsSum *prometheus.GaugeVec VectorSegmentsSum *prometheus.GaugeVec VectorDimensionsSumByVector *prometheus.GaugeVec VectorSegmentsSumByVector *prometheus.GaugeVec StartupProgress *prometheus.GaugeVec StartupDurations *prometheus.SummaryVec StartupDiskIO *prometheus.SummaryVec ShardsLoaded *prometheus.GaugeVec ShardsUnloaded *prometheus.GaugeVec ShardsLoading *prometheus.GaugeVec ShardsUnloading *prometheus.GaugeVec // RAFT-based schema metrics SchemaWrites *prometheus.SummaryVec SchemaReadsLocal *prometheus.SummaryVec SchemaReadsLeader *prometheus.SummaryVec SchemaWaitForVersion *prometheus.SummaryVec TombstoneFindLocalEntrypoint *prometheus.CounterVec TombstoneFindGlobalEntrypoint *prometheus.CounterVec TombstoneReassignNeighbors *prometheus.CounterVec TombstoneDeleteListSize *prometheus.GaugeVec Group bool // Keeping metering to only the critical buckets (objects, vectors_compressed) // helps cut down on noise when monitoring LSMCriticalBucketsOnly bool // Deprecated metrics, keeping around because the classification features // seems to sill use the old logic. However, those metrics are not actually // used for the schema anymore, but only for the classification features. SchemaTxOpened *prometheus.CounterVec SchemaTxClosed *prometheus.CounterVec SchemaTxDuration *prometheus.SummaryVec // Vectorization T2VBatches *prometheus.GaugeVec T2VBatchQueueDuration *prometheus.HistogramVec T2VRequestDuration *prometheus.HistogramVec T2VTokensInBatch *prometheus.HistogramVec T2VTokensInRequest *prometheus.HistogramVec T2VRateLimitStats *prometheus.GaugeVec T2VRequestsPerBatch *prometheus.HistogramVec }
func GetMetrics ¶
func GetMetrics() *PrometheusMetrics
func (*PrometheusMetrics) DeleteClass ¶ added in v1.21.7
func (pm *PrometheusMetrics) DeleteClass(className string) error
DeleteClass deletes all metrics that match the class name, but do not have a shard-specific label. See [DeleteShard] for more information.
func (*PrometheusMetrics) DeleteShard ¶ added in v1.21.7
func (pm *PrometheusMetrics) DeleteShard(className, shardName string) error
Delete Shard deletes existing label combinations that match both the shard and class name. If a metric is not collected at the shard level it is unaffected. This is to make sure that deleting a single shard (e.g. multi-tenancy) does not affect metrics for existing shards.
In addition, there are some metrics that we explicitly keep, such as vector_dimensions_sum as they can be used in billing decisions.
func (*PrometheusMetrics) FinishLoadingShard ¶ added in v1.23.0
func (pm *PrometheusMetrics) FinishLoadingShard(className string) error
Move the shard from in progress to loaded
func (*PrometheusMetrics) FinishUnloadingShard ¶ added in v1.23.0
func (pm *PrometheusMetrics) FinishUnloadingShard(className string) error
Move the shard from in progress to unloaded
func (*PrometheusMetrics) NewUnloadedshard ¶ added in v1.23.0
func (pm *PrometheusMetrics) NewUnloadedshard(className string) error
Register a new, unloaded shard
func (*PrometheusMetrics) StartLoadingShard ¶ added in v1.23.0
func (pm *PrometheusMetrics) StartLoadingShard(className string) error
Move the shard from unloaded to in progress
func (*PrometheusMetrics) StartUnloadingShard ¶ added in v1.23.0
func (pm *PrometheusMetrics) StartUnloadingShard(className string) error
Move the shard from loaded to in progress
type TenantOffloadMetrics ¶ added in v1.28.0
type TenantOffloadMetrics struct { // NOTE: These ops are not GET or PUT requests to object storage. // these are one of the `download`, `upload` or `delete`. Because we use s5cmd to talk // to object storage currently. Which supports these operations at high level. FetchedBytes prometheus.Counter TransferredBytes prometheus.Counter OpsDuration *prometheus.HistogramVec }
func NewTenantOffloadMetrics ¶ added in v1.28.0
func NewTenantOffloadMetrics(cfg Config, reg prometheus.Registerer) *TenantOffloadMetrics