Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions charts/coprocessor-sql-exporter/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v2
name: fhevm-sql-exporter
description: A Helm chart for Kubernetes
type: application
version: 1.0.0
appVersion: "1.16.0"
dependencies:
- name: prometheus-sql-exporter
repository: oci://ghcr.io/prometheus-community/charts
version: 0.4.0
85 changes: 85 additions & 0 deletions charts/coprocessor-sql-exporter/config/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# This configuration can be tested with https://github.com/justwatchcom/sql_exporter
# Configuration reference: https://github.com/justwatchcom/sql_exporter/blob/master/config.yml.dist
jobs:
- name: "coprocessor-database"
interval: '30s'
connections:
- 'postgres://{{DATABASE_USERNAME}}:{{DATABASE_PASSWORD}}@{{DATABASE_ENDPOINT}}/{{DATABASE_NAME}}'
startup_sql:
- 'SET lock_timeout = 1000'
- 'SET idle_in_transaction_session_timeout = 100'
queries:
- name: "allowed_handles_txn_sent"
help: "Number of allowed handles transactions sent"
labels:
- "status"
values:
- "count"
query: |
SELECT 'txn_sent' AS status, count(*)::float
FROM allowed_handles
WHERE txn_is_sent = true
UNION ALL
SELECT 'txn_unsent' AS status, count(*)::float
FROM allowed_handles
WHERE txn_is_sent = false;
- name: "ciphertext_txn_sent"
help: "Number of ciphertext transactions sent"
labels:
- "status"
values:
- "count"
query: |
SELECT 'txn_sent' AS status, count(*)::float
FROM ciphertext_digest
WHERE txn_is_sent = true
UNION ALL
SELECT 'txn_unsent' AS status, count(*)::float
FROM ciphertext_digest
WHERE txn_is_sent = false;
- name: "computations_completion"
help: "Number of computations done"
labels:
- "status"
values:
- "count"
query: |
SELECT 'completed' AS status, COUNT(*)::float
FROM computations
WHERE is_completed = true
UNION ALL
SELECT 'uncompleted', COUNT(*)::float
FROM computations
WHERE is_completed = false;
- name: "pbs_completion"
help: "Number of PBS done"
labels:
- "status"
values:
- "count"
query: |
SELECT 'completed' AS status, COUNT(*)::float
FROM pbs_computations
WHERE is_completed = true
UNION ALL
SELECT 'uncompleted', COUNT(*)::float
FROM pbs_computations
WHERE is_completed = false;
- name: "ciphertexts"
help: "Number of ciphertexts in ciphertexts table"
labels:
- "status"
values:
- "count"
query: |
SELECT COUNT(*)::float
FROM ciphertexts;
- name: "zkproof"
help: "Number of remaining ZK-Proof to process"
labels:
- "status"
values:
- "count"
query: |
SELECT COUNT(*)::float
FROM verify_proofs;
7 changes: 7 additions & 0 deletions charts/coprocessor-sql-exporter/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: coprocessor-sql-exporter-config
data:
config: |-
{{ .Files.Get "config/config.yml" | indent 4 }}
38 changes: 38 additions & 0 deletions charts/coprocessor-sql-exporter/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
prometheus-sql-exporter:
replicaCount: 1

image:
repository: ghcr.io/justwatchcom/sql_exporter
tag: "v0.9"

serviceMonitor:
enabled: true
interval: 30s

extraEnvs:
- name: DATABASE_ENDPOINT
valueFrom:
secretKeyRef:
name: database-credentials
key: endpoint
- name: DATABASE_USERNAME
valueFrom:
secretKeyRef:
name: database-credentials
key: username
- name: DATABASE_PASSWORD
valueFrom:
secretKeyRef:
name: database-credentials
key: password
- name: DATABASE_NAME
value: "coprocessor"
extraVolumes:
- name: custom-config
configMap:
name: coprocessor-sql-exporter-config
extraVolumeMounts:
- name: custom-config
mountPath: /custom-config.yml
subPath: config
configFilePath: "/custom-config.yml"