Skip to content

Conversation

@NathanFlurry
Copy link
Member

No description provided.

@vercel vercel bot temporarily deployed to Preview – rivetkit-serverless January 6, 2026 03:16 Inactive
@vercel
Copy link

vercel bot commented Jan 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

4 Skipped Deployments
Project Deployment Review Updated (UTC)
rivet-cloud Ignored Ignored Jan 6, 2026 3:16am
rivet-inspector Ignored Ignored Preview Jan 6, 2026 3:16am
rivet-site Ignored Ignored Preview Jan 6, 2026 3:16am
rivetkit-serverless Skipped Skipped Jan 6, 2026 3:16am

@graphite-app
Copy link
Contributor

graphite-app bot commented Jan 6, 2026

Merge activity

  • Jan 6, 3:16 AM UTC: NathanFlurry added this pull request to the Graphite merge queue.
  • Jan 6, 3:17 AM UTC: CI is running for this pull request on a draft pull request (#3758) due to your merge queue CI optimization settings.
  • Jan 6, 3:18 AM UTC: Merged by the Graphite merge queue via draft PR: #3758.

Copy link
Member Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add the label merge-queue to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@claude
Copy link

claude bot commented Jan 6, 2026

Code Review

Summary

This PR updates metrics to use Prometheus conventions properly by migrating from OpenTelemetry-style metrics to native Prometheus metric types.

Changes Reviewed

1. gasoline/metrics.rs - New FIND_WORKFLOWS_BATCH_DURATION metric

✅ Good: Added a new Histogram metric without labels for batch workflow finding operations.

2. gasoline/db/kv/mod.rs - Metric usage update

✅ Good: Migrated from OpenTelemetry's .record() with KeyValue to Prometheus's .observe().
✅ Good: Correctly uses the new label-free FIND_WORKFLOWS_BATCH_DURATION histogram.

Note: The old code had workflow_name: batch as a label, which wasn't particularly useful for cardinality. The new approach of using a separate metric without labels is cleaner.

3. pegboard/ops/runner/drain.rs - Metric usage update

✅ Good: Migrated from OpenTelemetry's .add() with KeyValue array to Prometheus's .with_label_values() + .inc_by().
✅ Good: Properly removed the unused rivet_metrics::KeyValue import.
✅ Good: Correctly preserves the label values (namespace_id, runner_name) in the proper order matching the metric definition.


Overall Assessment

✅ Code Quality: Clean migration following Prometheus conventions
✅ Best Practices: Properly uses label-based metrics where appropriate
✅ Potential Bugs: None identified
✅ Performance: No performance concerns
✅ Security: No security concerns

Minor Observations

  1. Consistency check: Verify that the existing FIND_WORKFLOWS_DURATION metric at line 992 of gasoline/src/db/kv/mod.rs is still being used correctly elsewhere (it already uses the Prometheus-style .with_label_values().observe() pattern).

  2. Documentation: Consider if the description for FIND_WORKFLOWS_BATCH_DURATION could be more specific (e.g., Duration to find workflows in batch mode vs Duration to find workflows).


Verdict

LGTM ✅ - This is a straightforward metrics migration that correctly updates the API calls to match Prometheus conventions. The changes are minimal, focused, and maintain the same observability capabilities.

@graphite-app graphite-app bot closed this Jan 6, 2026
@graphite-app graphite-app bot deleted the 01-05-fix_engine_update_metrics_to_prometheus branch January 6, 2026 03:18
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