Documentation ¶
Index ¶
- type ICollector
- type Settings
- type TrivyCollector
- func (c *TrivyCollector) Collect(ch chan<- prometheus.Metric)
- func (c *TrivyCollector) Describe(ch chan<- *prometheus.Desc)
- func (c *TrivyCollector) Name() string
- func (c *TrivyCollector) Scan(ctx context.Context) error
- func (c *TrivyCollector) Settings() Settings
- func (c *TrivyCollector) StartLoop(ctx context.Context, interval time.Duration)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ICollector ¶
type ICollector interface { Name() string Settings() Settings Scan(context.Context) error StartLoop(context.Context, time.Duration) Describe(ch chan<- *prometheus.Desc) Collect(ch chan<- prometheus.Metric) }
ICollector defines the interface that need to be implemented by each collector
type TrivyCollector ¶
type TrivyCollector struct { Vulnerabilities *prometheus.GaugeVec VulnerabilitiesSum *prometheus.GaugeVec // contains filtered or unexported fields }
TrivyCollector defines the trivy collector instance
func NewTrivyCollector ¶
func NewTrivyCollector( trivyClient client.TrivyClient, settings Settings, logger *logrus.Logger, ) *TrivyCollector
NewTrivyCollector creates a new collector instance
func (*TrivyCollector) Collect ¶
func (c *TrivyCollector) Collect(ch chan<- prometheus.Metric)
Collect implements the prometheus colletor interface method
func (*TrivyCollector) Describe ¶
func (c *TrivyCollector) Describe(ch chan<- *prometheus.Desc)
Describe implements the prometheus colletor interface method
func (*TrivyCollector) Name ¶
func (c *TrivyCollector) Name() string
Name returns the collectors friendly name
func (*TrivyCollector) Scan ¶
func (c *TrivyCollector) Scan(ctx context.Context) error
Scan checks the discovered docker images in parallel and maps the results to prometheus metrics
func (*TrivyCollector) Settings ¶
func (c *TrivyCollector) Settings() Settings
Settings returns the collectors settings
Click to show internal directories.
Click to hide internal directories.