opentelemetry-rust icon indicating copy to clipboard operation
opentelemetry-rust copied to clipboard

feat: Add export_unsampled option to BatchSpanProcessor for recording but unsampled spans

Open Copilot opened this issue 4 months ago • 7 comments

  • [x] Add export_unsampled option to BatchSpanProcessor configuration
  • [x] Update both sync and async BatchSpanProcessor implementations to use export_unsampled
  • [x] Add comprehensive tests for export_unsampled functionality
  • [x] Minimize changes by storing only export_unsampled field instead of entire config
  • [x] Fix code formatting issues with cargo fmt --all

Progress Summary

All lint failures have been addressed by running cargo fmt --all. The formatting changes include:

  • Fixed trailing whitespace in comments
  • Properly formatted long lines and function calls
  • Standardized test assertion formatting
  • Improved import statement formatting

The feature implementation is complete and all code style issues are resolved.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot avatar Aug 27 '25 21:08 Copilot

@cijothomas 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

Copilot avatar Aug 27 '25 21:08 Copilot

Watching along to see how far Copilot can get! happy to take up the PR if it gets stuck or needs any follow prompts

agent-adam avatar Aug 27 '25 21:08 agent-adam

Codecov Report

:x: Patch coverage is 98.03922% with 3 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 80.7%. Comparing base (7660a35) to head (ec062dc).

Files with missing lines Patch % Lines
opentelemetry-sdk/src/trace/span_processor.rs 97.9% 3 Missing :warning:
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #3139     +/-   ##
=======================================
+ Coverage   80.6%   80.7%   +0.1%     
=======================================
  Files        126     126             
  Lines      22195   22342    +147     
=======================================
+ Hits       17898   18042    +144     
- Misses      4297    4300      +3     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov[bot] avatar Aug 27 '25 21:08 codecov[bot]

@copilot Please make sure all lint failures are addressed. Running cargo fmt --all from the root will address most.

cijothomas avatar Sep 02 '25 15:09 cijothomas

@copilot Please make sure all lint failures are addressed. Running cargo fmt --all from the root will address most.

Fixed! I've run cargo fmt --all to address all formatting issues. The changes include proper line formatting, trailing whitespace removal, and standardized test assertion formatting. Commit cb08c5f

Copilot avatar Sep 02 '25 15:09 Copilot

Thanks for getting this out so quick, seems like the CI might of gotten stuck. Probably just needs to be restarted ?

agent-adam avatar Sep 10 '25 20:09 agent-adam

Specs PR is not yet merged - https://github.com/open-telemetry/opentelemetry-specification/issues/2986. Do we plan to introduce before that?

lalitb avatar Sep 11 '25 04:09 lalitb