Documentation
¶
Index ¶
- func EnsureNodeAgentSecret(ctx context.Context, mgr ctrl.Manager) error
- func TransformMetrics(original []byte, extraLabels map[string]string, prefix string) ([]byte, error)
- type CategoryStat
- type ContainerInfo
- type ContainerInfoResponse
- type DeregisterContainerPayload
- type FindDrivesResponse
- type GetContainerInfoRequest
- type GroupedMetrics
- type JSONRPCError
- type JSONRPCProxyPayload
- type JSONRPCResponse
- type LocalConfigStateResponse
- type LocalCpuUtilization
- type MetricDefinition
- type NodeAgent
- func (a *NodeAgent) ConfigureHttpServer(ctx context.Context) (*http.Server, error)
- func (a *NodeAgent) LoggerInjectionMiddleware(next http.Handler) http.Handler
- func (a *NodeAgent) LoggingMiddleware(next http.Handler) http.Handler
- func (a *NodeAgent) PanicRecovery(next http.Handler) http.Handler
- func (a *NodeAgent) RemoveContainer(containerId string)
- func (a *NodeAgent) Run(ctx context.Context, server *http.Server) error
- func (a *NodeAgent) Shutdown()
- type ProcessSummary
- type RegisterContainerPayload
- type ScrapeTarget
- type WekaDrive
- type WekaJSONRPCService
- type WekaStat
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureNodeAgentSecret ¶
func TransformMetrics ¶
func TransformMetrics(original []byte, extraLabels map[string]string, prefix string) ([]byte, error)
TransformMetrics takes original Prometheus metrics (in text format) as a []byte, applies extraLabels to every metric, and prepends a prefix (with dashes replaced by underscores) to every metric name. It preserves the original HELP and TYPE strings. It returns the transformed metrics as a single []byte.
Types ¶
type CategoryStat ¶
type ContainerInfo ¶
type ContainerInfo struct {
// contains filtered or unexported fields
}
type ContainerInfoResponse ¶
type ContainerInfoResponse struct {
ContainerMetrics weka.WekaContainerMetrics `json:"container_metrics,omitempty"`
}
type DeregisterContainerPayload ¶ added in v1.9.0
type DeregisterContainerPayload struct {
ContainerId string `json:"container_id"`
}
type FindDrivesResponse ¶ added in v1.9.0
type FindDrivesResponse struct {
Drives []domain.DriveInfo `json:"drives"`
Error string `json:"error,omitempty"`
}
FindDrivesResponse represents the response containing drive information
type GetContainerInfoRequest ¶
type GetContainerInfoRequest struct {
ContainerId string `json:"container_id"`
}
type GroupedMetrics ¶ added in v1.10.6
type GroupedMetrics map[CategoryStat][]WekaStat
type JSONRPCError ¶ added in v1.10.0
type JSONRPCError struct {
Code int `json:"code"`
Message string `json:"message"`
Data interface{} `json:"data,omitempty"`
}
JSONRPCError represents a JSONRPC 2.0 error object
type JSONRPCProxyPayload ¶ added in v1.10.0
type JSONRPCProxyPayload struct {
ContainerId string `json:"container_id"`
Method string `json:"method"`
Params map[string]any `json:"params"`
}
JSONRPCProxyPayload represents a generic JSONRPC call to be proxied to a container
type JSONRPCResponse ¶ added in v1.10.0
type JSONRPCResponse struct {
ID interface{} `json:"id"`
JSONRPC string `json:"jsonrpc"`
Result json.RawMessage `json:"result,omitempty"`
Error *JSONRPCError `json:"error,omitempty"`
}
JSONRPCResponse represents a JSONRPC 2.0 response
type LocalConfigStateResponse ¶
type LocalConfigStateResponse struct {
HasLease *bool `json:"has_lease"`
FilesystemsSummary []struct {
FilesystemId string `json:"filesystem_id"` // FSId<0>
Name string `json:"name"` // .config_fs
} `json:"filesystems_summary"`
DisksSummary []WekaDrive `json:"disks_summary"`
HostName string `json:"host_name"`
HostId string `json:"host_id"`
ProcessesSummary struct {
Drive ProcessSummary `json:"drive"`
Dataserv ProcessSummary `json:"dataserv"`
Management ProcessSummary `json:"management"`
Compute ProcessSummary `json:"compute"`
Total ProcessSummary `json:"total"`
Frontend ProcessSummary `json:"frontend"`
} `json:"processes_summary"`
}
type LocalCpuUtilization ¶ added in v1.10.0
type MetricDefinition ¶ added in v1.7.0
type MetricDefinition struct {
PromMetricName string
Help string
Type string
Modes []string
CategoryStats []CategoryStat
ValueTransform func(float64) float64
TagsFunc func(p processedStat) metrics2.TagMap
// CustomGetValueAndTagsFunc provides an alternative way to fetch metric values and tags,
// bypassing the CategoryStats logic. If set, it's used; otherwise, CategoryStats processing is attempted.
CustomGetValueAndTagsFunc func(ctx context.Context, container *ContainerInfo, baseLabels metrics2.TagMap) []metrics2.TaggedValue
Aggregate bool
Reduce bool
ReduceBy string
ReduceKeep []string
}
type NodeAgent ¶
type NodeAgent struct {
// contains filtered or unexported fields
}
func NewNodeAgent ¶
func (*NodeAgent) ConfigureHttpServer ¶
func (*NodeAgent) LoggerInjectionMiddleware ¶ added in v1.9.0
func (*NodeAgent) LoggingMiddleware ¶
func (*NodeAgent) RemoveContainer ¶ added in v1.9.0
RemoveContainer removes a container from tracking and cleans up its HTTP client
type ProcessSummary ¶
type RegisterContainerPayload ¶
type RegisterContainerPayload struct {
ContainerName string `json:"container_name"`
ContainerId string `json:"container_id"`
WekaContainerName string `json:"weka_container_name"`
Labels map[string]string `json:"labels"`
Mode string `json:"mode"`
ScrapeTargets []ScrapeTarget `json:"scrape_targets"`
PodStatus string `json:"pod_status"`
PodStatusStartTime time.Time `json:"pod_status_start_time"`
FeatureFlags *domain.FeatureFlags `json:"feature_flags,omitempty"` // feature flags
}
type ScrapeTarget ¶
type WekaJSONRPCService ¶ added in v1.9.0
type WekaJSONRPCService struct {
// contains filtered or unexported fields
}
WekaJSONRPCService handles JSONRPC communication with Weka containers via Unix sockets
func NewWekaJSONRPCService ¶ added in v1.9.0
func NewWekaJSONRPCService() *WekaJSONRPCService
NewWekaJSONRPCService creates a new JSONRPC service
func (*WekaJSONRPCService) Call ¶ added in v1.9.0
func (s *WekaJSONRPCService) Call(ctx context.Context, container *ContainerInfo, method string, params map[string]any, data interface{}) error
Call makes a JSONRPC call to the specified container
func (*WekaJSONRPCService) Close ¶ added in v1.9.0
func (s *WekaJSONRPCService) Close()
Close closes all HTTP clients and cleans up resources
func (*WekaJSONRPCService) RemoveContainer ¶ added in v1.9.0
func (s *WekaJSONRPCService) RemoveContainer(containerId string)
RemoveContainer removes the HTTP client for a specific container (when container is deleted)
type WekaStat ¶
type WekaStat struct {
Params struct {
FsId string `json:"fS,omitempty"` // integer in string format
Disk string `json:"disk,omitempty"` // integer in string format
FeIdx string `json:"feIdx,omitempty"`
} `json:"params"`
Stat string `json:"stat"`
NodeId string `json:"nodeId"` // NodeId<25011>
Category string `json:"category"`
Value string `json:"value"`
Unit string `json:"unit"`
}