Skip to content

chore: Include previous status to failed metric#735

Merged
zeljkoX merged 2 commits intomainfrom
metric-previous-status
Mar 31, 2026
Merged

chore: Include previous status to failed metric#735
zeljkoX merged 2 commits intomainfrom
metric-previous-status

Conversation

@zeljkoX
Copy link
Copy Markdown
Collaborator

@zeljkoX zeljkoX commented Mar 30, 2026

Summary

Add previous status to transaction failed metric.

Testing Process

Checklist

  • Add a reference to related issues in the PR description.
  • Add unit tests if applicable.

Note

If you are using Relayer in your stack, consider adding your team or organization to our list of Relayer Users in the Wild!

Summary by CodeRabbit

  • Chores
    • Enhanced transaction failure metrics to track previous transaction status, enabling more detailed monitoring of failure patterns.

@zeljkoX zeljkoX requested a review from a team as a code owner March 30, 2026 10:42
@zeljkoX zeljkoX requested a review from Copilot March 30, 2026 10:42
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 30, 2026

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a837a3e1-5d3c-44ce-b1e4-0bc2dbca75cd

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

Extended the TRANSACTIONS_FAILED Prometheus metric to include a previous_status label alongside existing labels. Updated the metric definition in src/metrics/mod.rs and modified src/repositories/transaction/transaction_redis.rs to compute and pass the previous transaction status when recording failures.

Changes

Cohort / File(s) Summary
Metrics Definition
src/metrics/mod.rs
Added previous_status to the TRANSACTIONS_FAILED counter vector's label schema, extending from 3 to 4 labels.
Metrics Recording
src/repositories/transaction/transaction_redis.rs
Computed previous_status as lowercased debug string of prior transaction status and updated all TRANSACTIONS_FAILED counter increments to include the new label value.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested labels

cla: allowlist

Suggested reviewers

  • NicoMolinaOZ
  • tirumerla

Poem

🐰✨ A label added, tracking the past,
Previous status now held fast,
From Failed to Expired's last breath,
Metrics record each step toward rest! 📊

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description matches the template structure but lacks critical details: Testing Process section is empty, and both checklist items remain unchecked without explanation or references to related issues or tests. Complete the Testing Process section describing how the changes were tested, and either provide issue references/unit tests or explain why they are not applicable.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title directly describes the main change: adding a 'previous_status' label to the failed transaction metric, which aligns with the core modifications in the changeset.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch metric-previous-status

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the transactions_failed_total Prometheus counter to include the transaction’s prior pipeline status as an additional label, enabling attribution of failures to pre- vs post-submission stages.

Changes:

  • Add a new previous_status label to the TRANSACTIONS_FAILED counter definition.
  • Populate and emit the previous_status label when incrementing failed/expired/canceled transaction metrics.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/repositories/transaction/transaction_redis.rs Adds previous_status labeling to TRANSACTIONS_FAILED increments during final-state transitions.
src/metrics/mod.rs Extends the TRANSACTIONS_FAILED CounterVec label set to include previous_status and documents the intent.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.24%. Comparing base (672ee6d) to head (fc0a5ca).
⚠️ Report is 18 commits behind head on main.

Additional details and impacted files
Flag Coverage Δ
ai 0.00% <ø> (ø)
dev 90.24% <ø> (+0.03%) ⬆️
properties 0.01% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@@            Coverage Diff             @@
##             main     #735      +/-   ##
==========================================
+ Coverage   90.20%   90.24%   +0.03%     
==========================================
  Files         289      289              
  Lines      120730   121244     +514     
==========================================
+ Hits       108905   109414     +509     
- Misses      11825    11830       +5     
Files with missing lines Coverage Δ
src/metrics/mod.rs 89.53% <ø> (ø)

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@zeljkoX zeljkoX merged commit b7d333e into main Mar 31, 2026
26 checks passed
@zeljkoX zeljkoX deleted the metric-previous-status branch March 31, 2026 05:30
@github-actions github-actions bot locked and limited conversation to collaborators Mar 31, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants