codex-storage / cs-codex-dist-tests

Distributed System Tests for Nim-Codex
4 stars 4 forks source link

Expose metrics during tests execution #48

Closed veaceslavdoina closed 1 year ago

veaceslavdoina commented 1 year ago

We already deployed Prometheus in Dist-Tests cluster and tested how we can get Codex metrics.

screenshots Screenshot 2023-08-22 at 16 41 15 Screenshot 2023-08-22 at 17 01 05

Configuration

  1. Configure Codex to expose the metrics
  2. Expose Codex container metrics port to be accessible for scraping
  3. Add Codex Pod annotations to use Prometheus Service Discovery for metrics scraping

Manifest

---
apiVersion: v1
kind: Pod
metadata:
  name: codex-metrics
  namespace: default
  annotations:
    prometheus.io/scrape: "true"
  labels:
    app: codex
    tests-type: dist-tests
spec:
  containers:
  - name: codex
    image: codexstorage/nim-codex:latest-dist-tests
    imagePullPolicy: Always
    env:
    - name: CODEX_METRICS
      value: "true"
    - name: CODEX_METRICS_ADDRESS
      value: "0.0.0.0"
    - name: CODEX_METRICS_PORT
      value: "8008"
    ports:
      - name: metrics
        containerPort: 8008
        protocol: TCP
veaceslavdoina commented 1 year ago

@benbierens, thank you for the assistance.

We did the following

Current state

To do