Documentation ¶
Index ¶
- Constants
- func Delta(current, previous map[string]map[string]float64) map[string]map[string]float64
- func SendNginxDownStatus(ctx context.Context, dims []*proto.Dimension, ...)
- type CPUTimes
- type Client
- type ContainerCPU
- type ContainerMemory
- type Disk
- type DiskIO
- type ExtendedStats
- type Load
- type MetricSourceLogger
- type NetIO
- type NginxAccessLog
- type NginxErrorLog
- type NginxOSS
- type NginxPlus
- type NginxProcess
- type NginxStatic
- type NginxWorker
- type NginxWorkerClient
- type NginxWorkerCollector
- type Swap
- type VirtualMemory
- type WorkerStats
- type Workers
Constants ¶
View Source
const ( OSSNamespace = "nginx" PlusNamespace = "plus" SystemNamespace = "system" ContainerNamespace = "container" OSSNginxType = "oss" PlusNginxType = "plus" CpuGroup = "cpu" MemoryGroup = "mem" )
View Source
const ( ContainerCpuMetricsWarning = "Unable to collect %s.%s metrics, %v" CpuCoresMetricName = "cores" CpuPeriodMetricName = "period" CpuQuotaMetricName = "quota" CpuSetCoresMetricName = "set.cores" CpuThrottlingTimeMetricName = "throttling.time" CpuThrottlingThrottledMetricName = "throttling.throttled" CpuThrottlingPeriodsMetricName = "throttling.periods" CpuThrottlingPercentageMetricName = "throttling.percent" )
View Source
const ( ContainerMemoryMetricsWarning = "Unable to collect %s.%s metrics, %v" OutOfMemoryMetricName = "oom" OutOfMemoryKillMetricName = "oom.kill" )
View Source
const ( HttpRequestBufferedMetricName = "http.request.buffered" UpstreamResponseBufferedMetricName = "upstream.response.buffered" UpstreamRequestFailedMetricName = "upstream.request.failed" UpstreamResponseFailedMetricName = "upstream.response.failed" )
View Source
const MOUNT_POINT = "mount_point"
View Source
const NETWORK_INTERFACE = "network_interface"
Variables ¶
This section is empty.
Functions ¶
func SendNginxDownStatus ¶
Types ¶
type CPUTimes ¶
type CPUTimes struct {
// contains filtered or unexported fields
}
func NewCPUTimesSource ¶
func NewCPUTimesSource(namespace string, env core.Environment) *CPUTimes
type Client ¶ added in v2.37.0
type Client interface { GetAvailableEndpoints() ([]string, error) GetAvailableStreamEndpoints() ([]string, error) GetStreamServerZones() (*plusclient.StreamServerZones, error) GetStreamUpstreams() (*plusclient.StreamUpstreams, error) GetStreamConnectionsLimit() (*plusclient.StreamLimitConnections, error) GetStreamZoneSync() (*plusclient.StreamZoneSync, error) GetNginxInfo() (*plusclient.NginxInfo, error) GetCaches() (*plusclient.Caches, error) GetProcesses() (*plusclient.Processes, error) GetSlabs() (*plusclient.Slabs, error) GetConnections() (*plusclient.Connections, error) GetHTTPRequests() (*plusclient.HTTPRequests, error) GetSSL() (*plusclient.SSL, error) GetServerZones() (*plusclient.ServerZones, error) GetUpstreams() (*plusclient.Upstreams, error) GetLocationZones() (*plusclient.LocationZones, error) GetResolvers() (*plusclient.Resolvers, error) GetHTTPLimitReqs() (*plusclient.HTTPLimitRequests, error) GetHTTPConnectionsLimit() (*plusclient.HTTPLimitConnections, error) GetWorkers() ([]*plusclient.Workers, error) }
type ContainerCPU ¶
type ContainerCPU struct {
// contains filtered or unexported fields
}
func NewContainerCPUSource ¶
func NewContainerCPUSource(namespace string, basePath string) *ContainerCPU
func (*ContainerCPU) Collect ¶
func (c *ContainerCPU) Collect(ctx context.Context, m chan<- *metrics.StatsEntityWrapper)
type ContainerMemory ¶
type ContainerMemory struct {
// contains filtered or unexported fields
}
func NewContainerMemorySource ¶
func NewContainerMemorySource(namespace string, basePath string) *ContainerMemory
func (*ContainerMemory) Collect ¶
func (c *ContainerMemory) Collect(ctx context.Context, m chan<- *metrics.StatsEntityWrapper)
type Disk ¶
type Disk struct {
// contains filtered or unexported fields
}
func NewDiskSource ¶
func NewDiskSource(namespace string, env core.Environment) *Disk
type DiskIO ¶
type DiskIO struct {
// contains filtered or unexported fields
}
func NewDiskIOSource ¶
func NewDiskIOSource(namespace string, env core.Environment) *DiskIO
type ExtendedStats ¶ added in v2.37.0
type ExtendedStats struct { *plusclient.Stats // contains filtered or unexported fields }
type MetricSourceLogger ¶ added in v2.24.0
type MetricSourceLogger struct {
// contains filtered or unexported fields
}
func NewMetricSourceLogger ¶ added in v2.24.0
func NewMetricSourceLogger() *MetricSourceLogger
func (*MetricSourceLogger) Log ¶ added in v2.24.0
func (m *MetricSourceLogger) Log(message string)
type NetIO ¶
type NetIO struct {
// contains filtered or unexported fields
}
func NewNetIOSource ¶
func NewNetIOSource(namespace string, env core.Environment) *NetIO
type NginxAccessLog ¶
type NginxAccessLog struct {
// contains filtered or unexported fields
}
func NewNginxAccessLog ¶
func NewNginxAccessLog( baseDimensions *metrics.CommonDim, namespace string, binary core.NginxBinary, nginxType string, collectionInterval time.Duration, ) *NginxAccessLog
func (*NginxAccessLog) Collect ¶
func (c *NginxAccessLog) Collect(ctx context.Context, m chan<- *metrics.StatsEntityWrapper)
func (*NginxAccessLog) Stop ¶
func (c *NginxAccessLog) Stop()
func (*NginxAccessLog) Update ¶
func (c *NginxAccessLog) Update(dimensions *metrics.CommonDim, collectorConf *metrics.NginxCollectorConfig)
type NginxErrorLog ¶
type NginxErrorLog struct {
// contains filtered or unexported fields
}
func NewNginxErrorLog ¶
func NewNginxErrorLog( baseDimensions *metrics.CommonDim, namespace string, binary core.NginxBinary, nginxType string, collectionInterval time.Duration, ) *NginxErrorLog
func (*NginxErrorLog) Collect ¶
func (c *NginxErrorLog) Collect(ctx context.Context, m chan<- *metrics.StatsEntityWrapper)
func (*NginxErrorLog) Stop ¶
func (c *NginxErrorLog) Stop()
func (*NginxErrorLog) Update ¶
func (c *NginxErrorLog) Update(dimensions *metrics.CommonDim, collectorConf *metrics.NginxCollectorConfig)
type NginxOSS ¶
type NginxOSS struct {
// contains filtered or unexported fields
}
func NewNginxOSS ¶
type NginxPlus ¶
type NginxPlus struct {
// contains filtered or unexported fields
}
NginxPlus generates metrics from NGINX Plus API
func NewNginxPlus ¶
type NginxProcess ¶
type NginxProcess struct {
// contains filtered or unexported fields
}
func NewNginxProcess ¶
func NewNginxProcess(baseDimensions *metrics.CommonDim, namespace string, binary core.NginxBinary, ) *NginxProcess
NewNginxProc collects metrics about nginx and nginx child processes
func (*NginxProcess) Collect ¶
func (c *NginxProcess) Collect(ctx context.Context, m chan<- *metrics.StatsEntityWrapper)
func (*NginxProcess) Stop ¶
func (c *NginxProcess) Stop()
func (*NginxProcess) Update ¶
func (c *NginxProcess) Update(dimensions *metrics.CommonDim, collectorConf *metrics.NginxCollectorConfig)
type NginxStatic ¶
type NginxStatic struct {
// contains filtered or unexported fields
}
func NewNginxStatic ¶
func NewNginxStatic(baseDimensions *metrics.CommonDim, namespace string) *NginxStatic
This is to output a static "nginx.status = 0" metric if NGINX is not running or detected or NGINX Plus API or stub_status API is not setup properly.
func (*NginxStatic) Collect ¶
func (c *NginxStatic) Collect(ctx context.Context, m chan<- *metrics.StatsEntityWrapper)
func (*NginxStatic) Stop ¶
func (c *NginxStatic) Stop()
func (*NginxStatic) Update ¶
func (c *NginxStatic) Update(dimensions *metrics.CommonDim, collectorConf *metrics.NginxCollectorConfig)
type NginxWorker ¶
type NginxWorker struct {
// contains filtered or unexported fields
}
func NewNginxWorker ¶
func NewNginxWorker(baseDimensions *metrics.CommonDim, namespace string, binary core.NginxBinary, collector NginxWorkerCollector, ) *NginxWorker
NewNginxWorker collects metrics about nginx child processes
func (*NginxWorker) Collect ¶
func (c *NginxWorker) Collect(ctx context.Context, m chan<- *metrics.StatsEntityWrapper)
func (*NginxWorker) Stop ¶
func (c *NginxWorker) Stop()
func (*NginxWorker) Update ¶
func (c *NginxWorker) Update(dimensions *metrics.CommonDim, collectorConf *metrics.NginxCollectorConfig)
type NginxWorkerClient ¶
type NginxWorkerClient struct {
// contains filtered or unexported fields
}
NginxWorkerClient allows you to fetch NGINX worker metrics from psutil via the PID of the master procs it implements an interface that we can mock for testing
func (*NginxWorkerClient) GetWorkerStats ¶
func (client *NginxWorkerClient) GetWorkerStats(childProcs []*proto.NginxDetails) (*WorkerStats, error)
GetWorkerStats fetches the nginx master & worker metrics from psutil.
type NginxWorkerCollector ¶
type NginxWorkerCollector interface {
GetWorkerStats(childProcs []*proto.NginxDetails) (*WorkerStats, error)
}
func NewNginxWorkerClient ¶
func NewNginxWorkerClient(env core.Environment) NginxWorkerCollector
type Swap ¶
type Swap struct {
// contains filtered or unexported fields
}
func NewSwapSource ¶
func NewSwapSource(namespace string, env core.Environment) *Swap
type VirtualMemory ¶
type VirtualMemory struct {
// contains filtered or unexported fields
}
func NewVirtualMemorySource ¶
func NewVirtualMemorySource(namespace string, env core.Environment) *VirtualMemory
func (*VirtualMemory) Collect ¶
func (c *VirtualMemory) Collect(ctx context.Context, m chan<- *metrics.StatsEntityWrapper)
type WorkerStats ¶
type WorkerStats struct {
Workers *Workers
}
WorkerStats represents NGINX worker metrics
Source Files ¶
Click to show internal directories.
Click to hide internal directories.