June 20-22 Announcing HashiConf Europe full schedule: keynotes, sessions, labs & more Register Now
  • Overview
    • Batch Processing Workloads
    • Edge Workload Management
    • Non-Containerized Application Orchestration
    • Simple Container Orchestration
  • Enterprise
  • Tutorials
  • Docs
  • API
  • Plugins
  • Tools
  • Community
GitHub—Stars on GitHub
Download
    • Overview
      • Overview
      • apm
      • dynamic_application_sizing
      • http
      • nomad
      • policy
      • policy_eval
      • source
      • strategy
      • target
      • telemetry
    • API
    • CLI
    • Policy
    • Telemetry
      • Overview
        • Overview
        • Datadog
        • Nomad API
        • Prometheus
        • Overview
        • Dynamic Application Sizing Average
        • Dynamic Application Sizing Max
        • Dynamic Application Sizing Percentile
        • Fixed Value
        • Pass-Through
        • Target Value
        • Threshold
        • Overview
        • Amazon Web Services Autoscaling Group
        • Azure Virtual Machine Scale Set
        • Dynamic Application Sizing
        • Google Cloud Engine Managed Instance Group
        • Nomad Task Group
      • Community
      • Overview
      • Checks
      • Node Selector Strategy
        • Overview
        • Base
        • APM
        • Strategy
        • Target
Type '/' to Search

»APM Plugins

APM plugins are used by the autoscaler to interact with an external APM system, returning metrics that are used by the autoscaler to inform scaling actions.

For a real-world example of a Nomad APM plugin implementation, see the prometheus plugin.

»Authoring APM Plugins

Authoring an APM plugin in Go can be accomplished by implementing the apm.APM interface, alongside a main package to launch the plugin.

The no-op APM plugin can be used as a starting point for new APM plugins.

»APM Plugin API

The base plugin interface must be implemented in addition to the following functions.

»Query(query string, timeRange sdk.TimeRange) (sdk.TimestampedMetrics, error)

The Query function is called by the agent during policy evaluation. The query argument is the opaque string from the scaling policy, and the timeRange indicates the period of time over which the query should be made. The response is a series of timestamped metrics; as such, the query semantics should be such that the backing APM will return a time series. An example is the CPU utilization of a task group, averaged over all current allocations.

»QueryMultiple(query string, timeRange sdk.TimeRange) ([]sdk.TimestampedMetrics, error)

The QueryMultiple method is similar to Query, except that the interface allows multiple time series to be returned. This endpoint is currently only used for Dynamic Application Sizing. An example would be to return the CPU utilization for all allocations during the time range.

github logoEdit this page
DocsAPIResourcesPrivacySecurityPress KitConsent Manager