Skip to content

Fix publish_outcomes and publish_errors_total metrics#97

Open
renaz6 wants to merge 1 commit intomainfrom
fixPublisherMetric
Open

Fix publish_outcomes and publish_errors_total metrics#97
renaz6 wants to merge 1 commit intomainfrom
fixPublisherMetric

Conversation

@renaz6
Copy link
Copy Markdown
Member

@renaz6 renaz6 commented Mar 19, 2026

Fixes https://github.com/comcast-cl/xmidt/issues/5734
and possibly https://github.com/comcast-cl/xmidt/issues/5736

  • Adds outcome.String() to the log statement so the string value of the outcome is logged, not just the corresponding iota constant
  • Adds a metric notifier for publish_errors_total when the publisher receives an error from attempting to produce a message
  • Moves the metric notifier for publish_outcomes before the handleOutcome call (could the handleOutcome call be cancelling the context before the metric is updated?)

@renaz6 renaz6 requested a review from piccione99 March 19, 2026 20:48
@renaz6 renaz6 self-assigned this Mar 19, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 19, 2026

Codecov Report

❌ Patch coverage is 30.00000% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.89%. Comparing base (093dcc3) to head (840f15b).

Files with missing lines Patch % Lines
internal/publisher/publisher.go 12.50% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #97      +/-   ##
==========================================
- Coverage   81.22%   80.89%   -0.33%     
==========================================
  Files          30       30              
  Lines        1731     1738       +7     
==========================================
  Hits         1406     1406              
- Misses        296      303       +7     
  Partials       29       29              
Flag Coverage Δ
unittests 80.89% <30.00%> (-0.33%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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