8000 feat(sdk-logs)!: Changed `LogRecord` to be an interface by svetlanabrennan · Pull Request #5749 · open-telemetry/opentelemetry-js · GitHub
[go: up one dir, main page]

Skip to content

Conversation

svetlanabrennan
Copy link
Contributor
@svetlanabrennan svetlanabrennan commented Jun 9, 2025

Which problem is this PR solving?

Created an interface for LogRecord so LogRecordProcessor#onEmit consumes the interface instead of the class.

Fixes #5736
Related to #5722

Short description of the changes

  • Created SdkLogRecord interface (there already is a LogRecord in the api-logs so I named this one SdkLogRecord to avoid confusion with the log record interface in the api-logs.
  • Updated LogRecord class to LogRecordImpl to avoid confusion with the interface
  • Updated various processors in the sdk-logs to use the new interface instead of the class
  • Updated tests to use the new interface

Type of change

Not sure if this would be considered a breaking change.

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Updated test

Checklist:

  • Followed the style guidelines of this project
  • Unit tests have been added
  • Documentation has been updated

@svetlanabrennan svetlanabrennan changed the title Remove exports class logs chore(sdk-logs): Changed LogRecord to be an interface Jun 9, 2025
@svetlanabrennan svetlanabrennan added api:logs Issues and PRs related to the Logs API sdk:logs Issues and PRs related to the Logs SDK and removed api:logs Issues and PRs related to the Logs API labels Jun 9, 2025
Copy link
codecov bot commented Jun 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.01%. Comparing base (f2cfd13) to head (d7539c8).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5749   +/-   ##
=======================================
  Coverage   95.01%   95.01%           
=======================================
  Files         303      303           
  Lines        7957     7957           
  Branches     1610     1610           
=======================================
  Hits         7560     7560           
  Misses        397      397           
Files with missing lines Coverage Δ
...xperimental/packages/sdk-logs/src/LogRecordImpl.ts 98.27% <100.00%> (ø)
experimental/packages/sdk-logs/src/Logger.ts 100.00% <100.00%> (ø)
...l/packages/sdk-logs/src/MultiLogRecordProcessor.ts 100.00% <100.00%> (ø)
...sdk-logs/src/export/BatchLogRecordProcessorBase.ts 93.61% <100.00%> (ø)
...es/sdk-logs/src/export/SimpleLogRecordProcessor.ts 93.33% <100.00%> (ø)
...ckages/web-common/src/SessionLogRecordProcessor.ts 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@svetlanabrennan svetlanabrennan marked this pull request as ready for review June 10, 2025 15:39
@svetlanabrennan svetlanabrennan requested a review from a team as a code owner June 10, 2025 15:39
@svetlanabrennan svetlanabrennan force-pushed the remove-exports-class-logs branch from c875d5b to c8bc527 Compare June 11, 2025 21:34
8000
Copy link
Member
@pichlermarc pichlermarc left a comment

Choose a reason for hiding this comment

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

Overall looks, good - but this is breaking change so it needs to be marked accordingly in the changelog 🙂

Copy link
Member
@hectorhdzg hectorhdzg left a comment

Choose a reason for hiding this comment

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

LGTM

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
@svetlanabrennan svetlanabrennan changed the title chore(sdk-logs): Changed LogRecord to be an interface chore(sdk-logs)!: Changed LogRecord to be an interface Jun 16, 2025
@pichlermarc pichlermarc changed the title chore(sdk-logs)!: Changed LogRecord to be an interface feat(sdk-logs)!: Changed LogRecord to be an interface Jun 17, 2025
@svetlanabrennan svetlanabrennan added this pull request to the merge queue Jun 17, 2025
Merged via the queue into open-telemetry:main with commit ec17ce4 Jun 17, 2025
25 checks passed
@svetlanabrennan svetlanabrennan deleted the remove-exports-class-logs branch June 17, 2025 18:55
martinkuba pushed a commit to martinkuba/opentelemetry-js that referenced this pull request Jul 17, 2025
…ry#5749)

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sdk:logs Issues and PRs related to the Logs SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[sdk-logs] change LogRecord to be an interface
3 participants
0