Skip to content

Move implementation from SDK header files to SDK cc#3887

Open
perhapsmaple wants to merge 7 commits intoopen-telemetry:mainfrom
perhapsmaple:header-cleanup
Open

Move implementation from SDK header files to SDK cc#3887
perhapsmaple wants to merge 7 commits intoopen-telemetry:mainfrom
perhapsmaple:header-cleanup

Conversation

@perhapsmaple
Copy link
Contributor

@perhapsmaple perhapsmaple commented Feb 23, 2026

Contributes to #1429

Changes

Please provide a brief description of the changes here.

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

Signed-off-by: Harish <140232061+perhapsmaple@users.noreply.github.com>
@codecov
Copy link

codecov bot commented Feb 23, 2026

Codecov Report

❌ Patch coverage is 87.75510% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.09%. Comparing base (1b3733f) to head (9692c92).

Files with missing lines Patch % Lines
sdk/src/metrics/view/view_registry.cc 82.46% 10 Missing ⚠️
sdk/src/metrics/aggregation/drop_aggregation.cc 0.00% 7 Missing ⚠️
sdk/src/trace/multi_recordable.cc 89.40% 7 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3887      +/-   ##
==========================================
+ Coverage   90.06%   90.09%   +0.03%     
==========================================
  Files         226      229       +3     
  Lines        7223     7253      +30     
==========================================
+ Hits         6505     6534      +29     
- Misses        718      719       +1     
Files with missing lines Coverage Δ
...lemetry/sdk/metrics/aggregation/drop_aggregation.h 66.67% <ø> (+44.45%) ⬆️
...ude/opentelemetry/sdk/metrics/view/view_registry.h 100.00% <100.00%> (+18.65%) ⬆️
sdk/include/opentelemetry/sdk/trace/span_data.h 100.00% <ø> (ø)
sdk/src/common/empty_attributes.cc 100.00% <100.00%> (ø)
sdk/src/trace/span_data.cc 100.00% <100.00%> (ø)
sdk/src/metrics/aggregation/drop_aggregation.cc 0.00% <0.00%> (ø)
sdk/src/trace/multi_recordable.cc 89.40% <89.40%> (ø)
sdk/src/metrics/view/view_registry.cc 82.46% <82.46%> (ø)

... and 1 file with indirect coverage changes

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

Signed-off-by: Harish <140232061+perhapsmaple@users.noreply.github.com>
@perhapsmaple perhapsmaple marked this pull request as ready for review March 3, 2026 15:36
@perhapsmaple perhapsmaple requested a review from a team as a code owner March 3, 2026 15:36
Signed-off-by: Harish <140232061+perhapsmaple@users.noreply.github.com>
Signed-off-by: Harish <140232061+perhapsmaple@users.noreply.github.com>
@perhapsmaple perhapsmaple marked this pull request as draft March 3, 2026 15:48
Signed-off-by: Harish <140232061+perhapsmaple@users.noreply.github.com>
@perhapsmaple perhapsmaple marked this pull request as ready for review March 3, 2026 16:55
Copy link
Member

@marcalff marcalff left a comment

Choose a reason for hiding this comment

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

Thanks for the fix.

This has a good size already, so please stabilize this PR to make it ready for review and merge. More files can be changed in a different PR, if so inclined.

To fix:

  • IWYU build failures
    • look for "Warning: include-what-you-use reported diagnostics:" in the build logs, in section iwyu_tool
  • Resolve merge conflicts
  • clang-format

Signed-off-by: Harish <140232061+perhapsmaple@users.noreply.github.com>
*/
static const opentelemetry::common::KeyValueIterableView<
std::array<std::pair<std::string, int32_t>, 0>> &
GetEmptyAttributes() noexcept
Copy link
Member

Choose a reason for hiding this comment

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

GetEmptyAttributes() was previously a static free function (header-only, internal linkage). It's now an externally-linked symbol requiring linkage against opentelemetry_common. While this shouldn't be an issue in practice, someone could theoretically be including this header standalone without linking the SDK - for their own utility purposes - and that would now fail with an undefined symbol error. Please add a CHANGELOG entry noting this change.

Copy link
Member

@lalitb lalitb left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. LGTM once the CI and merge conflict are resolved.

* @return the attributes for this event
*/
const std::unordered_map<std::string, opentelemetry::sdk::common::OwnedAttributeValue> &
GetAttributes() const noexcept
Copy link
Contributor

Choose a reason for hiding this comment

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

Move this and SpanDataLink::GetAttributes to .cc for consistency, since SpanData::GetAttributes has been moved to .cc.

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