Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

integration_aws-amazonmq-rabbitmq #458

Merged
merged 11 commits into from
Jun 20, 2023
12 changes: 12 additions & 0 deletions docs/severity.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- [fame_azure-vm-backup](#fame_azure-vm-backup)
- [fame_azure-vpn](#fame_azure-vpn)
- [integration_aws-alb](#integration_aws-alb)
- [integration_aws-amazonmq-rabbitmq](#integration_aws-amazonmq-rabbitmq)
- [integration_aws-apigateway](#integration_aws-apigateway)
- [integration_aws-backup](#integration_aws-backup)
- [integration_aws-beanstalk](#integration_aws-beanstalk)
Expand Down Expand Up @@ -153,6 +154,17 @@
|AWS ALB healthy instances percentage|X|X|-|-|-|


## integration_aws-amazonmq-rabbitmq

|Detector|Critical|Major|Minor|Warning|Info|
|---|---|---|---|---|---|
|AWS AmazonMQ RabbitMQ messages ready|X|X|-|-|-|
|AWS AmazonMQ RabbitMQ messages unacknowledged|X|X|-|-|-|
|AWS AmazonMQ RabbitMQ messages ack rate|X|X|-|-|-|
|AWS AmazonMQ RabbitMQ memory used|X|X|-|-|-|
|AWS AmazonMQ RabbitMQ disk free|X|X|-|-|-|


## integration_aws-apigateway

|Detector|Critical|Major|Minor|Warning|Info|
Expand Down
118 changes: 118 additions & 0 deletions modules/integration_aws-amazonmq-rabbitmq/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# AWS-AMAZONMQ-RABBITMQ SignalFx detectors

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
:link: **Contents**

- [How to use this module?](#how-to-use-this-module)
- [What are the available detectors in this module?](#what-are-the-available-detectors-in-this-module)
- [How to collect required metrics?](#how-to-collect-required-metrics)
- [Metrics](#metrics)
- [Related documentation](#related-documentation)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## How to use this module?

This directory defines a [Terraform](https://www.terraform.io/)
[module](https://www.terraform.io/language/modules/syntax) you can use in your
existing [stack](https://github.com/claranet/terraform-signalfx-detectors/wiki/Getting-started#stack) by adding a
`module` configuration and setting its `source` parameter to URL of this folder:

```hcl
module "signalfx-detectors-integration-aws-amazonmq-rabbitmq" {
source = "github.com/claranet/terraform-signalfx-detectors.git//modules/integration_aws-amazonmq-rabbitmq?ref={revision}"

environment = var.environment
notifications = local.notifications
aws_account_id = "fillme"
}
```

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](https://www.terraform.io/language/modules/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](https://registry.terraform.io/modules/claranet/detectors/signalfx) 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](https://github.com/claranet/terraform-signalfx-detectors/wiki/Getting-started#environment) used by this
instance of the module.
Its value will be added to the `prefixes` list at the start of the [detector
name](https://github.com/claranet/terraform-signalfx-detectors/wiki/Templating#example).
In general, it will also be used in the `filtering` internal sub-module to [apply
filters](https://github.com/claranet/terraform-signalfx-detectors/wiki/Guidance#filtering) based on our default
[tagging convention](https://github.com/claranet/terraform-signalfx-detectors/wiki/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](https://www.terraform.io/language/expressions/type-constraints#object) where each key represents an available
[detector rule severity](https://docs.splunk.com/observability/alerts-detectors-notifications/create-detectors-for-alerts.html#severity)
and its value is a list of recipients. Every recipients must respect the [detector notification
format](https://registry.terraform.io/providers/splunk-terraform/signalfx/latest/docs/resources/detector#notification-format).
Check the [notification binding](https://github.com/claranet/terraform-signalfx-detectors/wiki/Notifications-binding)
documentation to understand the recommended role of each severity.

These 3 parameters alongs with all variables defined in [common-variables.tf](common-variables.tf) are common to all
[modules](../) in this repository. Other variables, specific to this module, are available in
[variables.tf](variables.tf) and [variables-gen.tf](variables-gen.tf).
In general, the default configuration "works" but all of these Terraform
[variables](https://www.terraform.io/language/values/variables) make it possible to
customize the detectors behavior to better fit your needs.

Most of them represent usual tips and rules detailled in the
[guidance](https://github.com/claranet/terraform-signalfx-detectors/wiki/Guidance) documentation and listed in the
common [variables](https://github.com/claranet/terraform-signalfx-detectors/wiki/Variables) dedicated documentation.

Feel free to explore the [wiki](https://github.com/claranet/terraform-signalfx-detectors/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|
|---|---|---|---|---|---|
|AWS AmazonMQ RabbitMQ messages ready|X|X|-|-|-|
|AWS AmazonMQ RabbitMQ messages unacknowledged|X|X|-|-|-|
|AWS AmazonMQ RabbitMQ messages ack rate|X|X|-|-|-|
|AWS AmazonMQ RabbitMQ memory used|X|X|-|-|-|
|AWS AmazonMQ RabbitMQ disk free|X|X|-|-|-|

## How to collect required metrics?

This module deploys detectors using metrics reported by the
[AWS integration](https://docs.splunk.com/Observability/gdi/get-data-in/connect/aws/aws.html) configurable
with [this Terraform module](https://github.com/claranet/terraform-signalfx-integrations/tree/master/cloud/aws).


Check the [Related documentation](#related-documentation) section for more detailed and specific information about this module dependencies.



### Metrics


Here is the list of required metrics for detectors in this module.

* `AckRate`
* `MessageCount`
* `MessageReadyCount`
* `MessageUnacknowledgedCount`
* `RabbitMQDiskFree`
* `RabbitMQDiskFreeLimit`
* `RabbitMQMemLimit`
* `RabbitMQMemUsed`




## Related documentation

* [Terraform SignalFx provider](https://registry.terraform.io/providers/splunk-terraform/signalfx/latest/docs)
* [Terraform SignalFx detector](https://registry.terraform.io/providers/splunk-terraform/signalfx/latest/docs/resources/detector)
* [Splunk Observability integrations](https://docs.splunk.com/Observability/gdi/get-data-in/integrations.html)
* [AWS documentation: Monitoring Amazon MQ brokers](https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/security-logging-monitoring-cloudwatch.html#rabbitmq-logging-monitoring)
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module: AWS AmazonMQ RabbitMQ
name: messages ready

transformation: true
aggregation: true
filtering: "filter('namespace', 'AWS/AmazonMQ') and filter('stat', 'upper')"

signals:
signal:
metric: MessageReadyCount

rules:
critical:
threshold: 15000
comparator: ">"
lasting_duration: 20m
major:
threshold: 10000
comparator: ">"
lasting_duration: 20m
dependency: critical
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module: AWS AmazonMQ RabbitMQ
name: messages unacknowledged

transformation: true
aggregation: true
filtering: "filter('namespace', 'AWS/AmazonMQ') and filter('stat', 'upper')"
disabled: true

signals:
signal:
metric: MessageUnacknowledgedCount

rules:
critical:
threshold: 15000
comparator: ">"
lasting_duration: 20m
major:
threshold: 10000
comparator: ">"
lasting_duration: 20m
dependency: critical
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
module: AWS AmazonMQ RabbitMQ
name: messages ack rate

transformation: true
aggregation: true
filtering: "filter('namespace', 'AWS/AmazonMQ') and filter('stat', 'upper')"
disabled: true

signals:
msg:
metric: MessageCount
signal:
metric: AckRate

rules:
critical:
threshold: 0.016666666666666666
comparator: "<="
lasting_duration: 10m
lasting_at_least: 0.9
append_condition: and when(signal >= 0) and when(msg > 0)
description: is to low and there are ready or unack messages
major:
threshold: 0.03333333333333333
comparator: "<="
dependency: critical
lasting_duration: 10m
lasting_at_least: 0.9
append_condition: and when(signal >= 0) and when(msg > 0)
description: is to low and there are ready or unack messages
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module: AWS AmazonMQ RabbitMQ
name: memory used

transformation: true
aggregation: true
filtering: "filter('namespace', 'AWS/AmazonMQ') and filter('stat', 'upper')"
value_unit: "%"

signals:
A:
metric: RabbitMQMemUsed
B:
metric: RabbitMQMemLimit
signal:
formula: ((A / B).scale(100))

rules:
critical:
threshold: 90
comparator: ">"
lasting_duration: 10m
major:
threshold: 80
comparator: ">"
lasting_duration: 10m
dependency: critical
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module: AWS AmazonMQ RabbitMQ
name: disk free

transformation: true
aggregation: true
filtering: "filter('namespace', 'AWS/AmazonMQ') and filter('stat', 'upper')"
value_unit: "GiB"

signals:
A:
metric: RabbitMQDiskFree
B:
metric: RabbitMQDiskFreeLimit
signal:
formula: ((A - B)/1024**3)

rules:
critical:
threshold: 0.5
comparator: "<"
lasting_duration: 10m
major:
threshold: 1
comparator: "<"
lasting_duration: 10m
dependency: critical
4 changes: 4 additions & 0 deletions modules/integration_aws-amazonmq-rabbitmq/conf/readme.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
documentations:
- name: 'AWS documentation: Monitoring Amazon MQ brokers'
url: 'https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/security-logging-monitoring-cloudwatch.html#rabbitmq-logging-monitoring'

Loading