Skip to content

Geneva uploader: preserve borrows in EventName log routing and span passthrough routing #718

Description

@ragumarimuthu-git

While reviewing open-telemetry/otel-arrow#3600 (Geneva exporter attribute-based event/table-name routing), @lalitb noted two performance follow-ups in the Geneva uploader routing code. Both paths perform an unnecessary allocation/copy where the borrow could be preserved.

1. EventName log routing copies the borrowed event name only to perform the map lookup

routing.rs:363

The event name is already borrowed, but it is copied solely to perform the events map lookup. The lookup can be done against the borrowed &str (HashMap::get accepts &str via Borrow), avoiding the allocation.

2. Span passthrough routing copies source_value even though it already borrows from the span

routing.rs:164

In the span passthrough path, source_value is copied even though it already borrows from the span. The borrow should be preservable here as well.

Note

The log-attribute routing path is different and may still need ownership, because the pdata view value is a temporary — so it should be evaluated separately.

Suggested work

  • Preserve the borrow in both paths above (avoid the copy), keeping the API behavior identical.
  • Confirm the log-attribute path genuinely requires ownership (temporary pdata view value) and document why if so.

Filed as a tracking follow-up per PR review discussion; non-blocking for otel-arrow#3600.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions