Skip to content

Commit

Permalink
Merge pull request #51 from 3scale-ops/feat/manticore-exporter
Browse files Browse the repository at this point in the history
Feat/Add manticore prometheus-exporter and stable release v0.8.0
  • Loading branch information
3scale-robot authored Feb 22, 2024
2 parents a11944f + 3e97191 commit 1b5a9fe
Show file tree
Hide file tree
Showing 17 changed files with 2,045 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# To re-generate a bundle for another specific version without changing the standard setup, you can:
# - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2)
# - use environment variables to overwrite this value (e.g export VERSION=0.0.2)
VERSION ?= 0.7.0
VERSION ?= 0.8.0

# CHANNELS define the bundle channels used in the bundle.
# Add a new line here if you would like to change its default config. (E.g CHANNELS = "candidate,fast,stable")
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Current prometheus exporters `types` supported, managed by same prometheus-expor
* mysql
* postgresql
* sphinx
* manticore
* es (elasticsearch)
* cloudwatch
* probe (blackbox)
Expand Down Expand Up @@ -78,6 +79,9 @@ Operator is available at [OperatorHub.io](https://operatorhub.io/operator/promet
### Sphinx example dashboard
<img src="img/example-sphinx-dashboard.png" height="250px" alt="Example Sphinx Dashboard"></img>

### Manticore example dashboard
<img src="img/example-manticore-dashboard.png" height="250px" alt="Example Manticore Dashboard"></img>

### Elasticsearch example dashboard
<img src="img/example-es-dashboard.png" height="250px" alt="Example Elasticsearch Dashboard"></img>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ spec:
connection string definition (DSN)
type: string
dbHost:
description: For redis, memcached, sphinx and es exporters, the db
host to monitor
description: For redis, memcached, sphinx, manticore and es exporters,
the db host to monitor
type: string
dbPort:
description: For redis, memcached, sphinx and es exporters, the db
port to monitor
description: For redis, memcached, sphinx, manticore and es exporters,
the db port to monitor
type: integer
extraLabel:
properties:
Expand Down Expand Up @@ -224,6 +224,7 @@ spec:
- mysql
- postgresql
- sphinx
- manticore
- es
- cloudwatch
- probe
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ metadata:
operators.operatorframework.io/project_layout: ansible.sdk.operatorframework.io/v1
repository: https://github.com/3scale-ops/prometheus-exporter-operator
support: Red Hat, Inc.
name: prometheus-exporter-operator.v0.7.0
name: prometheus-exporter-operator.v0.8.0
namespace: placeholder
spec:
apiservicedefinitions: {}
Expand All @@ -60,6 +60,7 @@ spec:
* mysql
* postgresql
* sphinx
* manticore
* es (elasticsearch)
* cloudwatch
* probe (blackbox)
Expand Down Expand Up @@ -124,7 +125,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.annotations['olm.targetNamespaces']
image: quay.io/3scale/prometheus-exporter-operator:v0.7.0
image: quay.io/3scale/prometheus-exporter-operator:v0.8.0
livenessProbe:
httpGet:
path: /healthz
Expand Down Expand Up @@ -298,6 +299,7 @@ spec:
- cloudwatch
- blackbox
- sendgrid
- manticore
links:
- name: GitHub
url: https://github.com/3scale-ops/prometheus-exporter-operator
Expand All @@ -308,4 +310,4 @@ spec:
provider:
name: Red Hat
url: https://www.redhat.com
version: 0.7.0
version: 0.8.0
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ spec:
- mysql
- postgresql
- sphinx
- manticore
- es
- cloudwatch
- probe
Expand Down Expand Up @@ -173,10 +174,10 @@ spec:
type: object
dbHost:
type: string
description: For redis, memcached, sphinx and es exporters, the db host to monitor
description: For redis, memcached, sphinx, manticore and es exporters, the db host to monitor
dbPort:
type: integer
description: For redis, memcached, sphinx and es exporters, the db port to monitor
description: For redis, memcached, sphinx, manticore and es exporters, the db port to monitor
dbCheckKeys:
type: string
description: For redis exporter, the optional redis keys to monitor
Expand Down
2 changes: 1 addition & 1 deletion config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ kind: Kustomization
images:
- name: controller
newName: quay.io/3scale/prometheus-exporter-operator
newTag: v0.7.0
newTag: v0.8.0
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ spec:
* mysql
* postgresql
* sphinx
* manticore
* es (elasticsearch)
* cloudwatch
* probe (blackbox)
Expand Down Expand Up @@ -99,6 +100,7 @@ spec:
- cloudwatch
- blackbox
- sendgrid
- manticore
links:
- name: GitHub
url: https://github.com/3scale-ops/prometheus-exporter-operator
Expand Down
2 changes: 1 addition & 1 deletion docs/prometheus-exporter-crd-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ spec:
| **Field** | **Type** | **Required** | **Default value (some depends on type)** | **Description** |
|:---:|:---:|:---:|:---:|:---:|
| `type` | `string` | Yes | `none` | Supported prometheus-exporter types: `memcached`, `redis`, `mysql`, `postgresql`, `sphinx`, `es`, `cloudwatch`, `probe` |
| `type` | `string` | Yes | `none` | Supported prometheus-exporter types: `memcached`, `redis`, `mysql`, `postgresql`, `sphinx`, `es`, `cloudwatch`, `probe`, `sendgrid`, `manticore` |
| `serviceMonitor.enabled` | `bool` | No | `true` | Create (`true`) or not (`false`) ServiceMonitor object |
| `serviceMonitor.interval` | `string` | No | `30s` | Prometheus scrape interval |
| `grafanaDashboard.enabled` | `bool` | No | `true` | Create (`true`) or not (`false`) GrafanaDashboard object |
Expand Down
8 changes: 8 additions & 0 deletions examples/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ sphinx-create: ## SPHINX EXAMPLE - Create: CR (you need to provide a sphinx inst
sphinx-delete: ## SPHINX EXAMPLE - Delete: CR
$(KUBE_CLIENT) delete -f sphinx/ -n $(NAMESPACE) || true

## Manticore ##

manticore-create: ## MANTICORE EXAMPLE - Create: CR (you need to provide a manticore instance in advance)
$(KUBE_CLIENT) apply -f manticore/ --validate=false -n $(NAMESPACE)

manticore-delete: ## MANTICORE EXAMPLE - Delete: CR
$(KUBE_CLIENT) delete -f manticore/ -n $(NAMESPACE) || true

## Elasticsearch ##

elasticsearch-create: ## ELASTICSEARCH EXAMPLE - Create: CR (you need to provide a ES cluster in advance)
Expand Down
16 changes: 16 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,22 @@ $ make sphinx-create
$ make sphinx-delete
```

## Manticore

* Official doc: https://github.com/manticoresoftware/manticoresearch-prometheus

### Deploy example

* **Make sure you have a Manticore instance available, and dbHost/dbPort are correctly set on CR example file**
* Create `manticore-exporter` example ([example-CR](manticore/manticore-cr.yaml)):
```bash
$ make manticore-create
```
* Once tested, delete created objects:
```bash
$ make manticore-delete
```

## Elasticsearch

* Official doc: https://github.com/justwatchcom/elasticsearch_exporter
Expand Down
15 changes: 15 additions & 0 deletions examples/manticore/manticore-cr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: monitoring.3scale.net/v1alpha1
kind: PrometheusExporter
metadata:
name: staging-system-searchd
spec:
type: manticore
grafanaDashboard:
label:
key: monitoring-key
value: middleware
extraLabel:
key: threescale_component
value: system
dbHost: system-searchd
dbPort: 9306
Binary file added img/example-manticore-dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions prometheus-rules/manticore-prometheusrule.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: prometheus-exporter-manticore
spec:
groups:
- name: prometheus-exporter-manticore.rules
rules:
- alert: ManticoreDown
expr: absent(manticore_uptime_seconds) == 1
for: 1m
labels:
severity: critical
annotations:
message: "Manticore instance {{ $labels.prometheus_exporter }} is DOWN"
2 changes: 1 addition & 1 deletion roles/prometheusexporter/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---

## Main
type: "none" # memcached, redis, mysql, postgresql, sphinx, es, cloudwatch, sendgrid
type: "none" # memcached, redis, mysql, postgresql, sphinx, es, cloudwatch, sendgrid, manticore

## ServiceMonitor config
service_monitor_state: "present" # Converted to ansible state "absent" with an ansible set_fact task if CR boolean serviceMonitor.enabled = false
Expand Down
5 changes: 5 additions & 0 deletions roles/prometheusexporter/exporters/manticore/container.yml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
env:
- name: MANTICORE_HOST
value: "{{ db_host }}"
- name: MANTICORE_PORT
value: "{{ db_port }}"
Loading

0 comments on commit 1b5a9fe

Please sign in to comment.