Skip to content

Commit

Permalink
[prometheus-sql-exporter] Initial release (#4525)
Browse files Browse the repository at this point in the history
* [prometheus-sql-exporter] Initial release

Signed-off-by: Wilfried Roset <[email protected]>

* [prometheus-sql-exporter] Followup nits after review

Signed-off-by: Wilfried Roset <[email protected]>

* [prometheus-sql-exporter] Update CODEOWNERS

Signed-off-by: Wilfried Roset <[email protected]>

---------

Signed-off-by: Wilfried Roset <[email protected]>
  • Loading branch information
wilfriedroset authored May 13, 2024
1 parent 24d4002 commit 6952aa3
Show file tree
Hide file tree
Showing 17 changed files with 923 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
/charts/prometheus-redis-exporter/ @acondrat @zanhsieh
/charts/prometheus-smartctl-exporter/ @kfox1111 @zeritti
/charts/prometheus-snmp-exporter/ @miouge1 @walker-tom @xiu
/charts/prometheus-sql-exporter/ @wilfriedroset
/charts/prometheus-stackdriver-exporter/ @apenney @rpahli
/charts/prometheus-statsd-exporter/ @scDisorder
/charts/prometheus-systemd-exporter/ @capuche2412 @maxime1907
Expand Down
23 changes: 23 additions & 0 deletions charts/prometheus-sql-exporter/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
16 changes: 16 additions & 0 deletions charts/prometheus-sql-exporter/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: v2
description: Prometheus SQL Exporter
name: prometheus-sql-exporter
version: 0.1.0
appVersion: v0.5.4
home: https://github.com/justwatchcom/sql_exporter
sources:
- https://github.com/justwatchcom/sql_exporter
- https://github.com/prometheus-community/helm-charts/tree/main/charts/prometheus-sql-exporter
keywords:
- prometheus
- sql
- monitoring
maintainers:
- name: wilfriedroset
type: application
57 changes: 57 additions & 0 deletions charts/prometheus-sql-exporter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Prometheus SQL Exporter

Prometheus exporter for SQL testing

Learn more: [https://github.com/justwatchcom/sql_exporter](https://github.com/justwatchcom/sql_exporter)

This chart creates a SQL-Exporter deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.

## Prerequisites

- Kubernetes 1.27+
- Helm >= 3.0

## Get Repository Info

```console
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update
```

_See [`helm repo`](https://helm.sh/docs/helm/helm_repo/) for command documentation._

## Install Chart

```console
helm install [RELEASE_NAME] prometheus-community/prometheus-sql-exporter
```

_See [configuration](#configuration) below._

_See [helm install](https://helm.sh/docs/helm/helm_install/) for command documentation._

## Uninstall Chart

```console
helm uninstall [RELEASE_NAME]
```

This removes all the Kubernetes components associated with the chart and deletes the release.

_See [helm uninstall](https://helm.sh/docs/helm/helm_uninstall/) for command documentation._

## Upgrading Chart

```console
helm upgrade [RELEASE_NAME] [CHART] --install
```

_See [helm upgrade](https://helm.sh/docs/helm/helm_upgrade/) for command documentation._

## Configuration

See [Customizing the Chart Before Installing](https://helm.sh/docs/intro/using_helm/#customizing-the-chart-before-installing). To see all configurable options with detailed comments, visit the chart's [values.yaml](./values.yaml), or run these configuration commands:

```console
helm show values prometheus-community/prometheus-sql-exporter
```
15 changes: 15 additions & 0 deletions charts/prometheus-sql-exporter/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
1. Get the application URL by running these commands:
{{- if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "prometheus-sql-exporter.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get svc -w {{ template "prometheus-sql-exporter.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "prometheus-sql-exporter.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "prometheus-sql-exporter.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl port-forward $POD_NAME 8080:9187
{{- end }}
Loading

0 comments on commit 6952aa3

Please sign in to comment.