Skip to content

Add OpenTelemetry per-LV metrics - #11

Merged
msdmazvoid merged 4 commits into
mainfrom
feature/otel-lv-metrics
Nov 10, 2026
Merged

msdmazvoid merged 4 commits into
mainfrom
feature/otel-lv-metrics

Conversation

@msdmazvoid

@msdmazvoid msdmazvoid commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds per-logical-volume metrics to a pull-based OpenTelemetry/Prometheus registry. A dedicated plaintext metrics listener can be enabled so collectors do not need to handle mTLS; the existing mTLS /metrics endpoint remains available.

Per-LV metrics

OpenTelemetry instruments carry these labels:

  • kouja.owner
  • kouja.volume_id
  • kouja.lv_name
  • kouja.vg_name
  • kouja.storage_class
  • kouja.state
  • kouja.export_protocol when exported

Metrics: kouja.lv.requested_bytes, actual_bytes, observed_bytes, present, exported, active_sessions, and info.

Prometheus translation produces names such as kouja_lv_requested_bytes and kouja_lv_active_sessions.

Metrics listeners

observability:
  metrics:
    enabled: true
    address: 127.0.0.1:9100
  otel:
    enabled: true
    service_name: kouja-agent
  • The dedicated listener serves plaintext /metrics so a collector can scrape without mTLS.
  • It is disabled and loopback-only by default.
  • The existing mTLS /metrics endpoint on port 9443 remains available.
  • OTel instruments and the legacy kouja metrics share one registry, so one scrape returns both.
  • Collection reads all non-deleted volume statuses rather than the admin UI's 256-row page.

Verification

  • make test
  • make lint
  • make coverage-check (80.4%, floor 80%)
  • OTel manual-reader tests verify every per-LV gauge and label
  • Handler test verifies OTel and legacy metrics are served together
  • Listener test verifies /metrics serving and shutdown

No OTLP push endpoint, interval, or headers are required.

voidstarit added 4 commits November 9, 2026 18:33
Add optional OTLP/gRPC metrics export with per-logical-volume size, presence, export, and session gauges labeled by owner, volume, LV, VG, storage class, and state. Collection reads all live volume statuses rather than the admin UI page limit.
Replace the OTLP push exporter with an OpenTelemetry-backed Prometheus registry served on the existing mTLS /metrics endpoint. The collector now scrapes metrics instead of receiving pushed data.
Allow collectors to scrape /metrics without mTLS by configuring observability.metrics.address. The listener is disabled and loopback-only by default; the existing mTLS metrics endpoint remains available.
@msdmazvoid
msdmazvoid merged commit ab07b1f into main Nov 10, 2026
2 checks passed
@msdmazvoid
msdmazvoid deleted the feature/otel-lv-metrics branch November 10, 2026 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant