Skip to content

fix(RHINENG-32811): preserve patch upload identity - #2380

Merged
MichaelMraka merged 3 commits into
RedHatInsights:masterfrom
rodrigonull:fix/otel-inventory-request-id
Nov 9, 2026
Merged

MichaelMraka merged 3 commits into
RedHatInsights:masterfrom
rodrigonull:fix/otel-inventory-request-id

Conversation

@rodrigonull

@rodrigonull rodrigonull commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Jira

RHINENG-32811

What

Preserve each host’s upload identity through Patch evaluation and emit OpenTelemetry completion events for ingestion SLA measurement.

Why

Accurate latency measurements require matching Patch completion to the original upload, including paths that complete without producing a host-apps message.

How

  • Keep request IDs and traceparents paired with each host during batched evaluation, including repeated hosts.
  • Record rh.ingestion.completed after evaluation results commit successfully.
  • Record successful no-work completion for unchanged hosts, skipped stale systems, and older evaluation messages.
  • Retain native host-apps publication. The external correlation service handles correlation, deduplication, and SLA metrics through the existing OTel pipeline.

Testing

  • 152 tests passed across the affected packages; one existing test skipped.
  • Focused race checks and configured Go linters passed.
  • Tested real archive uploads through Ingress, Puptoo, HBI, and Patch using local Kafka, PostgreSQL, Collector, Tempo, the correlator, and Prometheus.
  • Verified normal evaluation, unchanged-host processing, and processing with host-apps publication disabled.
  • Failed commits emitted no completion marker; a successful retry emitted completion.
  • Compared Prometheus SLA counts with persisted correlation records.

Secure Coding Practices Checklist GitHub Link

Secure Coding Checklist

  • Input Validation
  • Output Encoding
  • Authentication and Password Management
  • Session Management
  • Access Control
  • Cryptographic Practices
  • Error Handling and Logging
  • Data Protection
  • Communication Security
  • System Configuration
  • Database Security
  • File Management
  • Memory Management
  • General Coding Practices

Summary by Sourcery

Preserve per-host upload identity through patch evaluation and report processing completion for reliable ingestion correlation.

New Features:

  • Emit OpenTelemetry ingestion-completion events for successfully processed and terminal no-work host evaluations.

Bug Fixes:

  • Preserve the correct request ID and traceparent for each host throughout batched and repeated-host patch evaluations.

Enhancements:

  • Propagate upload correlation context to inventory views events while retaining native host-apps publication behavior.

Tests:

  • Add coverage for ingestion-completion event attributes, filtering, and per-host upload identity preservation.

Keep each host's request ID and trace context through batched evaluation
and native host-apps publication. Record processing completion after the
results commit, including successful no-work paths.

The external trace correlator owns SLA correlation and deduplication.
Remove the prototype delivery outbox, completion HTTP client, migration,
relay settings and documentation; preserve native business publication.

Assisted-by: GPT-6
@rodrigonull
rodrigonull requested a review from a team as a code owner November 4, 2026 19:41
@sourcery-ai

sourcery-ai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Implementation

Pair each host with its own request ID and traceparent during batched evaluation, then carry that identity into evaluation and inventory-view publication.

  • evaluator/evaluate.go L431-439, L740-756, L774-782 (+5 small edits)
  • evaluator/inventory_views.go L57

Emit ingestion-completion events only for successful processing and terminal no-work paths, including the unchanged-upload path.

  • base/telemetry/ingestion.go L1-25
  • evaluator/evaluate.go L528-529
  • listener/upload.go L11, L183-184

Tests

Verify completion-event eligibility, attributes, and timing, alongside preservation of per-host upload identity and omission of internal ingestion fields from serialized events.

  • base/mqueue/platform_event_test.go L83-84
  • base/telemetry/ingestion_test.go L1-63
  • evaluator/inventory_views_test.go L63-100

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Needs a human reviewer. The new completion event exports organization, request, and host identifiers through tracing, and an exported event cannot be recalled by reverting the code. If those identifiers should not leave this service or the event is emitted at the wrong completion point, the affected trace records remain.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@codecov-commenter

codecov-commenter commented Nov 4, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.61702% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.49%. Comparing base (cfa4b73) to head (03149b1).

Files with missing lines Patch % Lines
evaluator/evaluate.go 90.62% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2380      +/-   ##
==========================================
+ Coverage   60.42%   60.49%   +0.07%     
==========================================
  Files         156      157       +1     
  Lines       10209    10240      +31     
==========================================
+ Hits         6169     6195      +26     
- Misses       3412     3417       +5     
  Partials      628      628              
Flag Coverage Δ
unittests 60.49% <93.61%> (+0.07%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 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.

@MichaelMraka
MichaelMraka merged commit 036619c into RedHatInsights:master Nov 9, 2026
8 checks passed
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.

3 participants