Skip to content

[Telemetry] Observability: Metrics & Context Propagation #379

Description

@Abishekcs

Implementation Plan

Phase 1 Telemetry primitives (rage)

  • Rage::Telemetry.every(ms), wraps Iodine.run_every handles boot timing internally (Iodine.running? and on_state(:on_start))
  • Write Specs along with each PR.

Phase 2 Socket & connection metrics (rage & rage-iodine)

rage-iodine exposes no accept-queue depth. We add them, following the existing pattern (task_inc!/task_dec!/stopping? core fn in fio.c, declaration in fio.h and Ruby wrapper + registration in
iodine_defer.c).

Metric:

  • Socket backlog (Accept Queue), new C method Iodine.socket_backlog in iodine: save the listener's fd when fio_listen runs, then read the kernel's accept-queue length (handshaked (ESTABLISHED) connections waiting for accept()) via getsockopt(TCP_INFO) tcpi_unacked.
  • Rage::Telemetry.socket_backlog, method-based reader exposing the Iodine server accept queue.
  • Update existing spec or add new if required according to the changes.

Phase 3 OpenTelemetry metrics (opentelemetry-instrumentation-rage)

  • Event loop lag via Telemetry.every
  • GC pressure gauges via periodic GC.stat sampling
  • Observable gauges for all Rage raw keys
  • Test the metrics are correct using the SDK's , then confirm they arrive at a real Collector running locally

Phase 4 Grafana dashboard

  • Connect to Grafana dashboard

Phase 5 Context propagation (rage)

  • Make Current.user (and all CurrentAttributes) survive every fiber boundary — enqueue, task execution and Fiber.schedule

Phase 6 Benchmark & docs

  • Benchmarks
  • Complete spec coverage for the new metrics layer
  • Docs + production monitoring guide

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions