Documentation
¶
Index ¶
- func ErrInternalServerError(err error) render.Renderer
- func NewQueryable(store *store.Store, agentIDFunc func() string) metricQueryable
- type API
- type AgentInfo
- type AgentStatus
- type CPUUsage
- type Container
- type Containers
- type Data
- func (d *Data) AgentInformation(w http.ResponseWriter, r *http.Request)
- func (d *Data) AgentStatus(w http.ResponseWriter, r *http.Request)
- func (d *Data) Containers(w http.ResponseWriter, r *http.Request)
- func (d *Data) Facts(w http.ResponseWriter, r *http.Request)
- func (d *Data) Logs(w http.ResponseWriter, _ *http.Request)
- func (d *Data) Processes(w http.ResponseWriter, r *http.Request)
- func (d *Data) Services(w http.ResponseWriter, r *http.Request)
- func (d *Data) Tags(w http.ResponseWriter, r *http.Request)
- type ErrResponse
- type Fact
- type LabelInput
- type MemoryUsage
- type MetricInput
- type Pagination
- type Process
- type Service
- type SwapUsage
- type Tag
- type Topinfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrInternalServerError ¶
func NewQueryable ¶
NewQueryable returns a metricQueryable that only do queries on the main agent.
Types ¶
type API ¶
type API struct {
BindAddress string
StaticCDNURL string
LocalUIDisabled bool
Endpoints config.WebEndpoints
DB metricQueryable
ContainerRuntime containerInterface
PsFact *facts.ProcessProvider
FactProvider *facts.FactProvider
Discovery *discovery.Discovery
AgentInfo agentInterface
PrometheusExporter http.Handler
Threshold *threshold.Registry
DiagnosticPage func(ctx context.Context) string
DiagnosticArchive func(ctx context.Context, w types.ArchiveWriter) error
// contains filtered or unexported fields
}
API contains API's port.
type AgentInfo ¶
type AgentStatus ¶
type AgentStatus struct {
ServiceName string `json:"serviceName"`
Status float64 `json:"status"`
StatusDescription string `json:"statusDescription"`
}
func (*AgentStatus) Render ¶
func (a *AgentStatus) Render(_ http.ResponseWriter, _ *http.Request) error
type CPUUsage ¶
type CPUUsage struct {
User float64 `json:"User"`
Nice float64 `json:"Nice"`
System float64 `json:"System"`
Idle float64 `json:"Idle"`
IOWait float64 `json:"IOWait"`
Guest float64 `json:"Guest"`
GuestNice float64 `json:"GuestNice"`
Irq float64 `json:"IRQ"`
SoftIrq float64 `json:"SoftIRQ"`
Steal float64 `json:"Steal"`
}
type Container ¶
type Container struct {
Command string `json:"command"`
CreatedAt *time.Time `json:"createdAt,omitempty"`
ID string `json:"id"`
Image string `json:"image"`
InspectJSON string `json:"inspectJSON"`
Name string `json:"name"`
StartedAt *time.Time `json:"startedAt,omitempty"`
State string `json:"state"`
FinishedAt *time.Time `json:"finishedAt,omitempty"`
IoWriteBytes float64 `json:"ioWriteBytes"`
IoReadBytes float64 `json:"ioReadBytes"`
NetBitsRecv float64 `json:"netBitsRecv"`
NetBitsSent float64 `json:"netBitsSent"`
MemUsedPerc float64 `json:"memUsedPerc"`
CPUUsedPerc float64 `json:"cpuUsedPerc"`
}
type Containers ¶
type Containers struct {
Count int `json:"count"`
CurrentCount int `json:"currentCount"`
Containers []*Container `json:"containers"`
}
func (*Containers) Render ¶
func (c *Containers) Render(_ http.ResponseWriter, _ *http.Request) error
type Data ¶
type Data struct {
// contains filtered or unexported fields
}
func (*Data) AgentInformation ¶
func (d *Data) AgentInformation(w http.ResponseWriter, r *http.Request)
AgentInformation returns some information about agent registration to Bleemeo Cloud.
func (*Data) AgentStatus ¶
func (d *Data) AgentStatus(w http.ResponseWriter, r *http.Request)
AgentStatus returns an integer that represent global server status over several metrics.
func (*Data) Containers ¶
func (d *Data) Containers(w http.ResponseWriter, r *http.Request)
Containers have 4 query parameters : - offset (string) : The offset of the first element to return. - limit (string) : The maximum number of elements to return. - allContainers (bool) : If true, return all containers, otherwise only running containers. - search (string) : The search string to filter containers.
func (*Data) Facts ¶
func (d *Data) Facts(w http.ResponseWriter, r *http.Request)
Facts returns a list of facts discovered by agent.
func (*Data) Processes ¶
func (d *Data) Processes(w http.ResponseWriter, r *http.Request)
Processes returns a list of topInfo, they have 1 query parameter : - search (string) : The container ID to filter processes.
type ErrResponse ¶
type ErrResponse struct {
Err error `json:"-"` // low-level runtime error
HTTPStatusCode int `json:"-"` // http response status code
StatusText string `json:"status"` // user-level status message
AppCode int64 `json:"code,omitempty"` // application-specific error code
ErrorText string `json:"error,omitempty"` // application-level error message, for debugging
}
func (*ErrResponse) Render ¶
func (e *ErrResponse) Render(_ http.ResponseWriter, r *http.Request) error
type LabelInput ¶
type MemoryUsage ¶
type MetricInput ¶
type MetricInput struct {
Labels []*LabelInput `json:"labels"`
}
type Pagination ¶
type Process ¶
type Process struct {
Pid int `json:"pid"`
Ppid int `json:"ppid"`
CreateTime time.Time `json:"create_time"`
Cmdline string `json:"cmdline"`
Name string `json:"name"`
MemoryRss int64 `json:"memory_rss"`
CPUPercent float64 `json:"cpu_percent"`
CPUTime float64 `json:"cpu_time"`
Status string `json:"status"`
Username string `json:"username"`
Executable string `json:"executable"`
ContainerID string `json:"container_id"`
}
type Service ¶
type Service struct {
Name string `json:"name"`
ContainerID string `json:"containerId"`
IPAddress string `json:"ipAddress"`
ListenAddresses []string `json:"listenAddresses"`
ExePath string `json:"exePath"`
Active bool `json:"active"`
Status float64 `json:"status"`
StatusDescription *string `json:"statusDescription,omitempty"`
}