Skip to content

Conversation

@jutaro
Copy link
Contributor

@jutaro jutaro commented Sep 8, 2025

Summary

This PR introduces an end-to-end test for the metrics pipeline, covering everything from tracing a metric to scraping it via the Prometheus endpoint and validating the result. It is the first full-round verification of our metrics infrastructure.

Motivation

Until now, our metrics tests were mostly unit-level or partial integration checks. This new test ensures that:

  • The Prometheus simple server actually serves the metrics we trace.
  • Our tracer configuration and formatter properly register and emit metrics.
  • The scraping path produces the expected value, closing the loop between producer and consumer.

This increases confidence in the observability layer, especially ahead of future instrumentation work.

What the Test Does

  • Thread 1

    • Starts a Prometheus simple server bound to localhost:9090.
    • Sets up an ekgTracer and configures it.
    • Emits a Measure 42 metric.
    • Spawns Thread 2.
    • Waits for completion or shutdown signal.
  • Thread 2

    • Scrapes http://localhost:9090/metrics.
    • Parses the metric output into a map.
    • Looks up the "measure" metric and asserts its value is 42.
    • Fails early if the metric is missing or has an unexpected value.
  • On success, prints Got correct metric value ✔.

@jutaro jutaro requested review from a team as code owners September 8, 2025 13:55
@jutaro jutaro force-pushed the jutaro/metrcs-test2 branch from 908cfc2 to 78fde31 Compare September 8, 2025 14:11
@jutaro jutaro marked this pull request as draft September 8, 2025 14:13
@Russoul Russoul force-pushed the jutaro/metrcs-test2 branch from 45a379a to 7abaec9 Compare September 9, 2025 20:49
@jutaro jutaro force-pushed the jutaro/metrcs-test2 branch from d067c16 to 7dc1377 Compare September 30, 2025 15:24
@jutaro jutaro marked this pull request as ready for review October 13, 2025 14:53
@jutaro jutaro requested a review from a team October 13, 2025 14:53
@jutaro jutaro requested a review from a team as a code owner October 13, 2025 14:53
@jutaro jutaro force-pushed the jutaro/metrcs-test2 branch 2 times, most recently from 67519c7 to 35d7408 Compare October 14, 2025 11:04
Minimize cabal dependencies
Handle unavailable port
nix | cabal.project: bump CHaP and cardano-automation
Use unix-compat with tests
@jutaro jutaro force-pushed the jutaro/metrcs-test2 branch from 35d7408 to 8d77939 Compare October 20, 2025 11:30
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.

2 participants