Skip to content

Latest commit

 

History

History

smart-agent_haproxy

HAPROXY SignalFx detectors

🔗 Contents

How to use this module?

This directory defines a Terraform module you can use in your existing stack by adding a module configuration and setting its source parameter to URL of this folder:

module "signalfx-detectors-smart-agent-haproxy" {
  source = "github.com/claranet/terraform-signalfx-detectors.git//modules/smart-agent_haproxy?ref={revision}"

  environment   = var.environment
  notifications = local.notifications
}

Note the following parameters:

  • source: Use this parameter to specify the URL of the module. The double slash (//) is intentional and required. Terraform uses it to specify subfolders within a Git repo (see module sources). The ref parameter specifies a specific Git tag in this repository. It is recommended to use the latest "pinned" version in place of {revision}. Avoid using a branch like master except for testing purpose. Note that every modules in this repository are available on the Terraform registry and we recommend using it as source instead of git which is more flexible but less future-proof.

  • environment: Use this parameter to specify the environment used by this instance of the module. Its value will be added to the prefixes list at the start of the detector name. In general, it will also be used in the filtering internal sub-module to apply filters based on our default tagging convention by default.

  • notifications: Use this parameter to define where alerts should be sent depending on their severity. It consists of a Terraform object where each key represents an available detector rule severity and its value is a list of recipients. Every recipients must respect the detector notification format. Check the notification binding documentation to understand the recommended role of each severity.

These 3 parameters along with all variables defined in common-variables.tf are common to all modules in this repository. Other variables, specific to this module, are available in variables-gen.tf. In general, the default configuration "works" but all of these Terraform variables make it possible to customize the detectors behavior to better fit your needs.

Most of them represent usual tips and rules detailed in the guidance documentation and listed in the common variables dedicated documentation.

Feel free to explore the wiki for more information about general usage of this repository.

What are the available detectors in this module?

This module creates the following SignalFx detectors which could contain one or multiple alerting rules:

Detector Critical Major Minor Warning Info
Haproxy heartbeat X - - - -
Haproxy server status X - - - -
Haproxy backend status X - - - -
Haproxy session X X - - -
Haproxy 5xx response rate X X - - -
Haproxy 4xx response rate X X X - -

How to collect required metrics?

This module deploys detectors using metrics reported by the SignalFx Smart Agent Monitors.

Even if the Smart Agent is deprecated it remains an efficient, lightweight and simple monitoring agent which still works fine. See the official documentation for more information about this agent. You might find the related following documentations useful:

In addition, all of these monitors are still available in the Splunk Otel Collector, the Splunk distro of OpenTelemetry Collector which replaces SignalFx Smart Agent, thanks to the internal Smart Agent Receiver.

As a result:

  • any SignalFx Smart Agent monitor are compatible with the new agent OpenTelemetry Collector and related modules in this repository keep smart-agent as source name.
  • any OpenTelemetry receiver not based on an existing Smart Agent monitor is not available from old agent so related modules in this repository use otel-collector as source name.

Check the Related documentation section for more detailed and specific information about this module dependencies.

Monitors

You have to enable the following extraMetrics in your monitor configuration:

  • haproxy_session_limit
  • haproxy_session_total
  • haproxy_status
  • haproxy_request_total

The first one is available only from agent version v5.3.2.

Metrics

To filter only required metrics for the detectors of this module, add the datapointsToExclude parameter to the corresponding monitor configuration:

    datapointsToExclude:
      - metricNames:
        - '*'
        - '!haproxy_request_total'
        - '!haproxy_response_4xx'
        - '!haproxy_response_5xx'
        - '!haproxy_session_current'
        - '!haproxy_session_limit'
        - '!haproxy_status'

Related documentation