Skip to content

feat: sidecar Prometheus metrics, RPC connection pooling, cleanup#62

Merged
bdchatham merged 2 commits intomainfrom
feat/sidecar-metrics-and-rpc-pooling
Apr 3, 2026
Merged

feat: sidecar Prometheus metrics, RPC connection pooling, cleanup#62
bdchatham merged 2 commits intomainfrom
feat/sidecar-metrics-and-rpc-pooling

Conversation

@bdchatham
Copy link
Copy Markdown
Contributor

Summary

Prod hardening: sidecar observability and performance improvements.

Changes

  • Prometheus metricsseictl_task_duration_seconds (histogram), seictl_task_submissions_total, seictl_task_failures_total. Exposed at /v0/metrics via promhttp.Handler().
  • RPC connection poolingComparator holds two *rpc.Client instances constructed once in NewComparator, reused across all block/block_results queries. Eliminates per-request http.Client allocation in the comparison hot loop.
  • queryLatestHeight consolidated — replaced standalone function in result_export.go with rpc.NewStatusClient().LatestHeight(), eliminating duplicate /status parsing.
  • queryBlockResults pooled — uses a shared rpc.Client instead of constructing per-call.

Companion to

  • sei-k8s-controller#51 (sidecar probes, SubmittedAt, submission logging)

Test plan

  • go test ./sidecar/rpc/ — pass
  • go test ./sidecar/engine/ — pass
  • go test ./sidecar/shadow/ — pass
  • go test ./sidecar/server/ — pass
  • go test ./sidecar/tasks/ — pass
  • go build ./sidecar/... — clean

🤖 Generated with Claude Code

…Height consolidation

Observability:
- Prometheus metrics: seictl_task_duration_seconds (histogram),
  seictl_task_submissions_total, seictl_task_failures_total
- /v0/metrics endpoint via promhttp.Handler()
- Metrics instrumented in engine.execute and engine.Submit

RPC connection pooling:
- Comparator struct holds two *rpc.Client instances instead of
  endpoint strings. Constructed once in NewComparator, reused
  across all queryBlock/queryBlockResults/fetchRaw calls.
- queryBlock, queryBlockResults, fetchRawBlock, fetchRawBlockResults
  now accept *rpc.Client instead of constructing per-call.

Cleanup:
- queryLatestHeight in result_export.go replaced with
  rpc.NewStatusClient().LatestHeight() — eliminates duplicate
  /status parsing logic.
- queryBlockResults uses a shared rpc.Client instead of per-call.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Rename seictl_task_duration_seconds → seictl_task_execution_duration_seconds
  to clarify this measures handler wall-clock time, not submission latency
- Update help text to be explicit about measurement point
- go mod tidy

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bdchatham bdchatham merged commit 26aaecb into main Apr 3, 2026
2 checks passed
@bdchatham bdchatham deleted the feat/sidecar-metrics-and-rpc-pooling branch April 3, 2026 20:24
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