github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/website/content/tools/autoscaling/concepts/plugins/base.mdx (about)

     1  ---
     2  layout: docs
     3  page_title: Base Plugin
     4  description: Learn about how to author a Nomad Autoscaler plugin.
     5  ---
     6  
     7  # Base Plugin
     8  
     9  The base plugin is an interface required of all autoscaler plugins,
    10  providing a set of common operations.
    11  
    12  ## Plugin API
    13  
    14  #### `PluginInfo() (*PluginInfo, error)`
    15  
    16  A `PluginInfo` contains metadata about the plugin. For example,
    17  the Prometheus APM plugin returns the following;
    18  
    19  ```go
    20  PluginInfo{
    21      // Name of the plugin
    22      Name: "prometheus",
    23      // Plugin type: "apm", "strategy", or "target"
    24      PluginType: "apm"
    25  }
    26  ```
    27  
    28  #### `SetConfig(config map[string]string) error`
    29  
    30  The `SetConfig` function is called when starting an instance of the plugin. It contains the
    31  configuration for a named instance of the plugin as provided in the autoscaler [agent config][plugin_config].
    32  
    33  [plugin_config]: /tools/autoscaling/agent