| 1 | //go:build cgo |
| 2 | |
| 3 | package mp |
| 4 | |
| 5 | import ( |
| 6 | _ "embed" |
| 7 | |
| 8 | "github.com/netdata/netdata/go/plugins/plugin/framework/collectorapi" |
| 9 | "github.com/netdata/netdata/go/plugins/plugin/ibm.d/framework" |
| 10 | ) |
| 11 | |
| 12 | //go:embed config_schema.json |
| 13 | var configSchema string |
| 14 | |
| 15 | // New returns a new WebSphere MicroProfile collector instance. |
| 16 | func New() *Collector { |
| 17 | cfg := defaultConfig() |
| 18 | return &Collector{ |
| 19 | Collector: framework.Collector{ |
| 20 | Config: cfg.Config, |
| 21 | }, |
| 22 | Config: cfg, |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | func (c *Collector) Configuration() any { |
| 27 | cfg := c.Config |
| 28 | return &cfg |
| 29 | } |
| 30 | |
| 31 | func init() { |
| 32 | collectorapi.Register("websphere_mp", collectorapi.Creator{ |
| 33 | JobConfigSchema: configSchema, |
| 34 | Create: func() collectorapi.CollectorV1 { return New() }, |
| 35 | Config: func() any { |
| 36 | cfg := defaultConfig() |
| 37 | return &cfg |
| 38 | }, |
| 39 | }) |
| 40 | } |