Skip to content

feat(logs): add log protocol types #821

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 28 commits into from
Jun 6, 2025
Merged

feat(logs): add log protocol types #821

merged 28 commits into from
Jun 6, 2025

Conversation

lcian
Copy link
Member

@lcian lcian commented May 26, 2025

Implements types for Sentry logs.

  • The types are implemented according to the spec.
  • Instead of making a Logs EnvelopeItem type, I created an ItemContainer type. This will make it easier to add new "batched" items that will come in the future (Spans).
  • The only drawback of this is that each of those variants will need a De/Serialization wrapper to de/serialize with the intermediate items field. This was the best approach I found, I've tried others (ItemContainer<T> and Box<dyn ItemContainer> using a trait) but each of these has some issues.
  • I've made all of the structs/fields public for consistency with the already existing types. Also all the fields need to be readable and writable in before_send_log.

Closes #797

@getsentry getsentry deleted a comment from github-actions bot May 28, 2025
@getsentry getsentry deleted a comment from codecov bot May 28, 2025
@lcian lcian marked this pull request as ready for review May 28, 2025 11:42
@getsentry getsentry deleted a comment from github-actions bot May 28, 2025
Copy link

github-actions bot commented May 28, 2025

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 85704c0

Copy link

codecov bot commented May 28, 2025

Codecov Report

Attention: Patch coverage is 80.81395% with 33 lines in your changes missing coverage. Please review.

Project coverage is 72.94%. Comparing base (9c65afe) to head (85704c0).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #821      +/-   ##
==========================================
+ Coverage   72.81%   72.94%   +0.13%     
==========================================
  Files          63       63              
  Lines        7308     7477     +169     
==========================================
+ Hits         5321     5454     +133     
- Misses       1987     2023      +36     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lcian lcian merged commit 7abbb38 into master Jun 6, 2025
18 checks passed
@lcian lcian deleted the lcian/feat/logs-types branch June 6, 2025 07:47
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.

[Structured logging] Types
2 participants