Skip to content

Commit

Permalink
Adds rabbitmq-exporter for prometheus
Browse files Browse the repository at this point in the history
Adds rabbitmq-exporter to expose rabbitmq metrics.

JIRA: OSPC-250
  • Loading branch information
sulochan authored and cloudnull committed Feb 26, 2024
1 parent 4a26d76 commit ef934d2
Show file tree
Hide file tree
Showing 3 changed files with 193 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/kustomize-prometheus-rabbitmq-exporter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Kustomize GitHub Actions for Prometheus Rabbitmq exporter

on:
pull_request:
paths:
- kustomize/prometheus-rabbitmq-exporter/**
- .github/workflows/kustomize-prometheus-rabbitmq-exporter.yaml
jobs:
kustomize:
name: Kustomize
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: azure/setup-helm@v3
with:
version: latest
token: "${{ secrets.GITHUB_TOKEN }}"
id: helm
- name: Kustomize Install
working-directory: /usr/local/bin/
run: |
if [ ! -f /usr/local/bin/kustomize ]; then
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | sudo bash
fi
- name: Run Kustomize Build
run: |
kustomize build kustomize/prometheus-rabbitmq-exporter/ --enable-helm --helm-command ${{ steps.helm.outputs.helm-path }} > /tmp/rendered.yaml
- name: Return Kustomize Build
uses: actions/upload-artifact@v2
with:
name: kustomize-prometheus-rabbitmq-exporter-artifact
path: /tmp/rendered.yaml
7 changes: 7 additions & 0 deletions kustomize/prometheus-rabbitmq-exporter/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
helmCharts:
- name: prometheus-rabbitmq-exporter
repo: https://prometheus-community.github.io/helm-charts
releaseName: prometheus-rabbitmq-exporter
version: 1.11.0
includeCRDs: true
valuesFile: values.yaml
153 changes: 153 additions & 0 deletions kustomize/prometheus-rabbitmq-exporter/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
# Default values for prometheus-rabbitmq-exporter.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
image:
repository: kbudde/rabbitmq-exporter
tag: v0.29.0
pullPolicy: IfNotPresent
pullSecrets: []

service:
type: ClusterIP
externalPort: 9419
internalPort: 9419
labels: {}

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi

priorityClassName: ""

nodeSelector: {}

tolerations: []

affinity: {}

loglevel: info
rabbitmq:
url: http://rabbitmq:15672
user: guest
password: guest
# If existingUserSecret is set then user is ignored
existingUserSecret: rabbitmq-default-user
existingUserSecretKey: username
# If existingPasswordSecret is set then password is ignored
existingPasswordSecret: rabbitmq-default-user
existingPasswordSecretKey: password
capabilities: bert,no_sort
include_queues: ".*"
include_vhost: ".*"
skip_queues: "^$"
skip_verify: "false"
skip_vhost: "^$"
exporters: "exchange,node,overview,queue"
output_format: "TTY"
timeout: 30
max_queues: 0
excludeMetrics: ""
connection: "direct"
# Enables overriding env vars using an external ConfigMap.
configMapOverrideReference: ""

## Additional labels to set in the Deployment object. Together with standard labels from
## the chart
additionalLabels: {}

podLabels: {}

annotations: {
prometheus.io/scrape: "true",
prometheus.io/path: "/metrics",
prometheus.io/port: "9419",
}

prometheus:
monitor:
enabled: true
additionalLabels: {}
interval: 15s
namespace:
- openstack
- prometheus
metricRelabelings: []
relabelings: []
targetLabels: []

rules:
enabled: false
additionalLabels: {}
namespace: ""
additionalRules:
## These are just examples rules, please adapt them to your needs.
## Make sure to constraint the rules to the current service.
- alert: RabbitmqNodeDown
expr: rabbitmq_running{service="{{ template "prometheus-rabbitmq-exporter.fullname" . }}"} == 0
for: 5m
labels:
severity: warning
annotations:
summary: A Rabbitmq node is down
description: |
The Rabbitmq node {{ "{{ $labels.node }}" }} of
the cluster tracked by {{ "{{ $labels.service }}" }} was not running during the last 5m.
- alert: RabbitmqClusterDown
expr: |
rabbitmq_up{service="{{ template "prometheus-rabbitmq-exporter.fullname" . }}"} == 0
for: 5m
labels:
severity: critical
annotations:
summary: The Rabbitmq cluster {{ "{{ $labels.service }}" }} is maybe down.
description: |
The Rabbitmq exporter couldn't scrape any Rabbitmq node of the
cluster tracked by {{ "{{ $labels.service }}" }} during the last 5m, the cluster is maybe down.
- alert: RabbitMQClusterPartition
expr: rabbitmq_partitions{service="{{ template "prometheus-rabbitmq-exporter.fullname" . }}"} > 0
for: 5m
labels:
severity: critical
annotations:
summary: A cluster partition was detected
description: |
Cluster partition in Rabbitmq cluster tracked by {{ "{{ $labels.service }}" }} was detected
by the node {{ "{{ $labels.node }}" }}
- alert: RabbitmqOutOfMemory
expr: |
rabbitmq_node_mem_used{service="{{ template "prometheus-rabbitmq-exporter.fullname" . }}"}
/ rabbitmq_node_mem_limit{service="{{ template "prometheus-rabbitmq-exporter.fullname" . }}"}
* 100 > 90
for: 5m
labels:
severity: warning
annotations:
summary: The Rabbitmq node {{ "{{ $labels.node }}" }} is Out of memory
description: |
Memory available for Rabbmitmq node {{ "{{ $labels.node }}" }} is lower than 10%
- alert: RabbitmqTooManyConnections
expr: rabbitmq_connectionsTotal{service="{{ template "prometheus-rabbitmq-exporter.fullname" . }}"} > 1000
for: 5m
labels:
severity: warning
annotations:
summary: Too many connections to the Rabbitmq cluster
description: |
The Rabbitmq cluster tracked by {{ "{{ $labels.service }}" }} has too many connections {{ "{{ $value }}" }} (> 1000)
serviceAccount:
# Specifies whether a ServiceAccount should be created
create: true
# The name of the ServiceAccount to use.
# If not set and create is true, a name is generated using the fullname template
name:
annotations: {}

0 comments on commit ef934d2

Please sign in to comment.