Skip to content

Implement trace metric capture and batching in sentry-core #1023

@szokeasaurusrex

Description

@szokeasaurusrex

Implement the core metric capture path in sentry-core so captured metrics are buffered and sent as trace_metric envelope items, with an explicit enable_metrics option for fast disable behavior. This should cover feature flags and metric capture in Hub/Client, plus batcher integration and flush behavior, aligned with the metrics processing pipeline and buffering.

Scope

Apply the relevant logic from #997 where useful, focused on sentry-core/Cargo.toml, sentry-core/src/lib.rs, sentry-core/src/clientoptions.rs, sentry-core/src/hub.rs, sentry-core/src/client.rs, and sentry-core/src/batcher.rs. Include tests for disabled metrics, batch-size flushing, and flush on teardown. If code is reused from #997, include Co-authored-by: Joris Bayer <joris.bayer@sentry.io> in commit trailers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions