Skip to content

Commit

Permalink
refactor: Apply some formatting and update values
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikolai Rodionov committed Oct 8, 2023
1 parent aa36a47 commit 8c73f4d
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 77 deletions.
4 changes: 4 additions & 0 deletions helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ keywords:
home: https://github.com/burningalchemist/sql_exporter
sources:
- https://github.com/burningalchemist/sql_exporter
maintainers:
- name: Nikolai Rodionov
email: [email protected]
url: https://badhouseplants.net
2 changes: 2 additions & 0 deletions helm/ci/postgresql-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ tests:
prom:
service: prometheus-operated
namespace: monitoring
metricsEndpoint:
enabled: true

config:
target:
Expand Down
2 changes: 1 addition & 1 deletion helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spec:
{{- include "sql-exporter.selectorLabels" . | nindent 6 }}
template:
metadata:
annotations:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/secret.configuration.yaml") . | sha256sum }}
checksum/collectors: {{ include (print $.Template.BasePath "/configmap.collectors.yaml") . | sha256sum }}
labels:
Expand Down
2 changes: 2 additions & 0 deletions helm/templates/tests/test-connection.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if (((.Values.tests).metricsEndpoint).enabled) }}
---
apiVersion: v1
kind: ConfigMap
Expand Down Expand Up @@ -46,3 +47,4 @@ spec:
args:
- /test.sh
restartPolicy: Never
{{- end }}
2 changes: 1 addition & 1 deletion helm/templates/tests/test-servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.tests.serviceMonitor.enabled }}
{{- if (((.Values.tests).serviceMonitor).enabled) }}
---
apiVersion: v1
kind: ConfigMap
Expand Down
147 changes: 72 additions & 75 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,86 +3,89 @@
# ---------------------------------------------------------------------
image:
repository: burningalchemist/sql_exporter
pullPolicy: IfNotPresent
pullPolicy:
IfNotPresent
# tag: $IMAGE_TAG
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

service:
type: ClusterIP
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
service:
type: ClusterIP
port: 80
resources:
{}
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
podSecurityContext: {}
securityContext:
{}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000

resources: {}
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi

podSecurityContext: {}
securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000
# ---------------------------------------------------------------------
# -- Prometheus operator values
# ---------------------------------------------------------------------
serviceMonitor:
enabled: true
# ---------------------------------------------------------------------
# -- Prometheus operator values
# ---------------------------------------------------------------------
serviceMonitor:
enabled: true
interval: 15s
# ---------------------------------------------------------------------
# -- SQL exporter configuration
# -- For a comprehensive and comprehensively documented configuration
# -- file check out: https://github.com/burningalchemist/sql_exporter/blob/master/documentation/sql_exporter.yml
# ---------------------------------------------------------------------
config:
global:
scrape_timeout: 10s
# ---------------------------------------------------------------------
# -- SQL exporter configuration
# -- For a comprehensive and comprehensively documented configuration
# -- file check out: https://github.com/burningalchemist/sql_exporter/blob/master/documentation/sql_exporter.yml
# ---------------------------------------------------------------------

config:
global:
scrape_timeout: 10s
scrape_timeout_offset: 500ms
min_interval: 0s
max_connections: 3
max_idle_connections: 3
# ---------------------------------------------------------------------
# -- Target and collectors are not set so the chart is more flexible
# -- Please configure it yourself
# ---------------------------------------------------------------------
# target:
# data_source_name: 'sqlserver://prom_user:[email protected]:1433'
# collectors: [active_connections]
# collectors:
# - collector_name: active_connections
# metrics:
# - metric_name: active_connections
# type: gauge
# help: 'Active connections'
# key_labels:
# - "datname"
# - "usename"
# - "state"
# values:
# - "count"
# query_ref: active_connections
# queries:
# - query_name: active_connections
# query: |
# SELECT
# datname::text,
# usename::text,
# state::text,
# COUNT(state)::float AS count
# FROM pg_stat_activity
# GROUP BY datname, usename, state;
# collector_files:
# - "*.collector.yml"
# ---------------------------------------------------------------------
# -- Target and collectors are not set so the chart is more flexible
# -- Please configure it yourself
# ---------------------------------------------------------------------
# target:
# data_source_name: 'sqlserver://prom_user:[email protected]:1433'
# collectors: [active_connections]
# collectors:
# - collector_name: active_connections
# metrics:
# - metric_name: active_connections
# type: gauge
# help: 'Active connections'
# key_labels:
# - "datname"
# - "usename"
# - "state"
# values:
# - "count"
# query_ref: active_connections
# queries:
# - query_name: active_connections
# query: |
# SELECT
# datname::text,
# usename::text,
# state::text,
# COUNT(state)::float AS count
# FROM pg_stat_activity
# GROUP BY datname, usename, state;
# collector_files:
# - "*.collector.yml"

# ---------------------------------------------------------------------
# -- Collector Files
# ---------------------------------------------------------------------
# -- Collector files are mounter to /etc/sql_exporter/collectors dir
# -- Collector files are mounted to /etc/sql_exporter/collectors dir
# ---------------------------------------------------------------------
# collectorFiles:
# pricing_data_freshness.collector.yml:
Expand All @@ -102,9 +105,3 @@ image:
# SELECT Market, max(UpdateTime) AS LastUpdateTime
# FROM MarketPrices
# GROUP BY Market
# ---------------------------------------------------------------------
# -- These values only used for tests, users shouldn't set those
# ---------------------------------------------------------------------
tests:
serviceMonitor:
enabled: false

0 comments on commit 8c73f4d

Please sign in to comment.