Documentation ¶
Overview ¶
Package observability provides metrics, profiling, and etc.
Index ¶
- Variables
- func MetricsServerInterceptor() (grpc.UnaryServerInterceptor, grpc.StreamServerInterceptor)
- func NewMeterProvider(_ meter.Scope) meter.Provider
- func NewMetricService() run.Service
- func NewProfService() run.Service
- func UpdateAddress(name, address string)
- func UpdatePath(path string)
- type Collector
- type DiskUsage
- type ErrorResponse
- type MetricsGetter
- type SystemInfo
Constants ¶
This section is empty.
Variables ¶
var MetricsCollector = Collector{ // contains filtered or unexported fields }
MetricsCollector is a global metrics collector.
var ( // RootScope is the root scope for all metrics. RootScope = meter.NewHierarchicalScope("banyandb", "_") )
Functions ¶
func MetricsServerInterceptor ¶ added in v0.4.0
func MetricsServerInterceptor() (grpc.UnaryServerInterceptor, grpc.StreamServerInterceptor)
MetricsServerInterceptor returns a grpc.UnaryServerInterceptor and a grpc.StreamServerInterceptor.
func NewMeterProvider ¶ added in v0.4.0
NewMeterProvider returns a meter.Provider based on the given scope.
func NewMetricService ¶
NewMetricService returns a metric service.
func UpdateAddress ¶ added in v0.4.0
func UpdateAddress(name, address string)
UpdateAddress updates the address of the given name.
func UpdatePath ¶ added in v0.4.0
func UpdatePath(path string)
UpdatePath updates a path to monitoring its disk usage.
Types ¶
type Collector ¶ added in v0.4.0
type Collector struct {
// contains filtered or unexported fields
}
Collector is a metrics collector.
func (*Collector) Register ¶ added in v0.4.0
func (c *Collector) Register(name string, getter MetricsGetter)
Register registers a metrics getter.
func (*Collector) Unregister ¶ added in v0.4.0
Unregister unregisters a metrics getter.
type ErrorResponse ¶ added in v0.4.0
type ErrorResponse struct { Message string `json:"message"` OriginalError string `json:"original_error,omitempty"` }
ErrorResponse represents the error response.
type MetricsGetter ¶ added in v0.4.0
type MetricsGetter func()
MetricsGetter is a function that collects metrics.
type SystemInfo ¶ added in v0.4.0
type SystemInfo struct { Addresses map[string]string `json:"addresses"` DiskUsages map[string]*DiskUsage `json:"disk_usages"` NodeID string `json:"node_id"` Hostname string `json:"hostname"` Roles []string `json:"roles"` Uptime uint64 `json:"uptime"` CPUUsage float64 `json:"cpu_usage"` MemoryUsage float64 `json:"memory_usage"` sync.RWMutex }
SystemInfo represents the system information of a node.