Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 27, 2025

  • Add export_unsampled option to BatchSpanProcessor configuration
  • Update both sync and async BatchSpanProcessor implementations to use export_unsampled
  • Add comprehensive tests for export_unsampled functionality
  • Minimize changes by storing only export_unsampled field instead of entire config
  • 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.

Copy link
Contributor Author

Copilot AI commented Aug 27, 2025

@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.

@agent-adam
Copy link

agent-adam commented Aug 27, 2025

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

Copy link

codecov bot commented Aug 27, 2025

Codecov Report

❌ Patch coverage is 98.03922% with 3 lines in your changes missing coverage. Please review.
✅ 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 ⚠️
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     

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

Copilot AI and others added 2 commits August 27, 2025 21:59
Co-authored-by: cijothomas <5232798+cijothomas@users.noreply.github.com>
Co-authored-by: cijothomas <5232798+cijothomas@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] [Feature]: Add export_unsampled option to BatchSpanProcessor (opt-in export of recording but unsampled spans) Add export_unsampled option to BatchSpanProcessor for recording but unsampled spans Aug 27, 2025
@Copilot Copilot AI requested a review from cijothomas August 27, 2025 22:02
Copilot finished work on behalf of cijothomas August 27, 2025 22:02
…ntire config

- Remove config field from BatchSpanProcessor structs (both sync and async)
- Add export_unsampled bool field directly to structs
- Extract export_unsampled from config during construction
- Update sampling logic to use direct field access
- Fix tests to use sampled spans to maintain expected behavior
- Add Clone trait to BatchConfig for compatibility

This addresses the reviewer feedback to minimize unrelated changes while
preserving the export_unsampled functionality.

Co-authored-by: cijothomas <5232798+cijothomas@users.noreply.github.com>
Copilot finished work on behalf of cijothomas August 27, 2025 22:53
@Copilot Copilot AI requested a review from cijothomas August 27, 2025 22:53
Copy link

@agent-adam agent-adam left a comment

Choose a reason for hiding this comment

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

Changes look great!
seems like we might just run a quick lint and rename the PR.

max_export_batch_size: OTEL_BSP_MAX_EXPORT_BATCH_SIZE_DEFAULT,
max_export_timeout: OTEL_BSP_EXPORT_TIMEOUT_DEFAULT,
max_concurrent_exports: OTEL_BSP_MAX_CONCURRENT_EXPORTS_DEFAULT,
export_unsampled: false,

Choose a reason for hiding this comment

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

Could we also make this flag configurable via an environment variable, consistent with other BSP knobs? something like OTEL_BSP_EXPORT_UNSAMPLED

Copy link
Member

Choose a reason for hiding this comment

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

OTel spec has general put a halt of adding new env variables, as OTel is moving towards new configuration model. I am not sure if we should add another env variable now..

@cijothomas cijothomas changed the title Add export_unsampled option to BatchSpanProcessor for recording but unsampled spans feat: Add export_unsampled option to BatchSpanProcessor for recording but unsampled spans Sep 2, 2025
@cijothomas
Copy link
Member

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

Co-authored-by: cijothomas <5232798+cijothomas@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Sep 2, 2025

@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 finished work on behalf of cijothomas September 2, 2025 15:09
@agent-adam
Copy link

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

@lalitb
Copy link
Member

lalitb commented Sep 11, 2025

Specs PR is not yet merged - open-telemetry/opentelemetry-specification#2986. Do we plan to introduce before that?

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.

4 participants