Skip to content

feat(logs): add log protocol types#821

Merged
lcian merged 28 commits intomasterfrom
lcian/feat/logs-types
Jun 6, 2025
Merged

feat(logs): add log protocol types#821
lcian merged 28 commits intomasterfrom
lcian/feat/logs-types

Conversation

@lcian
Copy link
Copy Markdown
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

Comment thread sentry-types/src/protocol/v7.rs
@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
@github-actions
Copy link
Copy Markdown

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

@codecov
Copy link
Copy Markdown

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.

Comment thread sentry-types/src/protocol/v7.rs Outdated
Comment thread sentry-types/src/protocol/envelope.rs
Comment thread sentry-types/src/protocol/v7.rs
Comment thread sentry-types/src/protocol/v7.rs Outdated
@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