add inputname const
This commit is contained in:
parent
37f2f953f8
commit
23fdaf41be
|
|
@ -152,7 +152,8 @@ func (u *InputUnifi) pollController(c *Controller) (*poller.Metrics, error) {
|
||||||
|
|
||||||
// augmentMetrics is our middleware layer between collecting metrics and writing them.
|
// augmentMetrics is our middleware layer between collecting metrics and writing them.
|
||||||
// This is where we can manipuate the returned data or make arbitrary decisions.
|
// This is where we can manipuate the returned data or make arbitrary decisions.
|
||||||
// This function currently adds parent device names to client metrics.
|
// This method currently adds parent device names to client metrics and hashes PII.
|
||||||
|
// This method also converts our local *Metrics type into a slice of interfaces for poller.
|
||||||
func (u *InputUnifi) augmentMetrics(c *Controller, metrics *Metrics) *poller.Metrics {
|
func (u *InputUnifi) augmentMetrics(c *Controller, metrics *Metrics) *poller.Metrics {
|
||||||
if metrics == nil {
|
if metrics == nil {
|
||||||
return nil
|
return nil
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
PluginName = "unifi" // PluginName is the name of this input plugin.
|
||||||
defaultURL = "https://127.0.0.1:8443"
|
defaultURL = "https://127.0.0.1:8443"
|
||||||
defaultUser = "unifipoller"
|
defaultUser = "unifipoller"
|
||||||
defaultPass = "unifipoller"
|
defaultPass = "unifipoller"
|
||||||
|
|
@ -67,7 +68,7 @@ func init() { // nolint: gochecknoinits
|
||||||
u := &InputUnifi{}
|
u := &InputUnifi{}
|
||||||
|
|
||||||
poller.NewInput(&poller.InputPlugin{
|
poller.NewInput(&poller.InputPlugin{
|
||||||
Name: "unifi",
|
Name: PluginName,
|
||||||
Input: u, // this library implements poller.Input interface for Metrics().
|
Input: u, // this library implements poller.Input interface for Metrics().
|
||||||
Config: u, // Defines our config data interface.
|
Config: u, // Defines our config data interface.
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue