Skip to content

Add try_into_with_options with empty ConversionOptions struct#2811

Merged
jmacd merged 3 commits intoopen-telemetry:mainfrom
jmacd:jmacd/try_into_with_options
May 4, 2026
Merged

Add try_into_with_options with empty ConversionOptions struct#2811
jmacd merged 3 commits intoopen-telemetry:mainfrom
jmacd:jmacd/try_into_with_options

Conversation

@jmacd
Copy link
Copy Markdown
Contributor

@jmacd jmacd commented May 2, 2026

Change Summary

Replaces TryInto by a new TryIntoWithOptions and a default path, then mechanically converts the code.

What issue does this PR close?

Part of #2725
Split from #2792

Are there any user-facing changes?

None.

jmacd and others added 2 commits May 1, 2026 16:36
…on traits

Adds an empty ConversionOptions struct and TryFromWithOptions /
TryIntoWithOptions traits in pdata. Converts the OtapPayload and
OtapArrowRecords to OtlpProtoBytes conversions to use the new traits.
Adds Consumer::with_options.

The options struct is intentionally empty as a placeholder; size limits
and other knobs will be threaded through in a follow-up.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds default-helper methods (try_from_with_default, try_into_with_default)
to TryFromWithOptions / TryIntoWithOptions, and migrates all existing
TryFrom/TryInto callsites that previously used the implicit default
conversion to the new with_default helpers.

This is a mechanical rename that prepares for future per-callsite
ConversionOptions plumbing.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added rust Pull requests that update Rust code query-engine Query Engine / Transform related tasks query-engine-columnar Columnar query engine which uses DataFusion to process OTAP Batches labels May 2, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 2, 2026

Codecov Report

❌ Patch coverage is 96.17486% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.04%. Comparing base (f018901) to head (16ebc4b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2811   +/-   ##
=======================================
  Coverage   86.03%   86.04%           
=======================================
  Files         704      704           
  Lines      264591   264657   +66     
=======================================
+ Hits       227654   227715   +61     
- Misses      36413    36418    +5     
  Partials      524      524           
Components Coverage Δ
otap-dataflow 86.98% <96.17%> (+<0.01%) ⬆️
query_abstraction 80.61% <ø> (ø)
query_engine 90.76% <ø> (ø)
otel-arrow-go 52.45% <ø> (ø)
quiver 92.25% <ø> (ø)
🚀 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.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jmacd jmacd marked this pull request as ready for review May 4, 2026 17:48
@jmacd jmacd requested a review from a team as a code owner May 4, 2026 17:48
Copy link
Copy Markdown
Member

@albertlockett albertlockett left a comment

Choose a reason for hiding this comment

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

LGTM @jmacd

@jmacd jmacd added this pull request to the merge queue May 4, 2026
Merged via the queue into open-telemetry:main with commit b911578 May 4, 2026
78 of 79 checks passed
@jmacd jmacd deleted the jmacd/try_into_with_options branch May 4, 2026 19:59
let mut metrics_proto_encoder = MetricsProtoBytesEncoder::new();
let mut traces_proto_encoder = TracesProtoBytesEncoder::new();
let mut proto_buffer = ProtoBuffer::with_capacity(8 * 1024);
let mut proto_buffer = ProtoBuffer::default();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@jmacd Sorry didn't get my review in before merging. Is this change potentially a small perf regression since we're going from a pre-allocation via with_capacity to default?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

query-engine Query Engine / Transform related tasks query-engine-columnar Columnar query engine which uses DataFusion to process OTAP Batches rust Pull requests that update Rust code

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants